The Computational Beauty of Nature
Source code

diffuse

simulate diffusion limited aggregation

Full screen →

diffuse -help
  or
diffuse
       [-width  integer]  [-height integer] [-levels inte-
       ger]  [-num  integer]  [-steps  integer]   [-invis]
       [-seed   integer]   [-inv]  [-mag  integer]  [-term
       string]

Generates diffusion limited aggregate growth that looks like coral.

A special type of stochastic fractal is created by the random action of many particles. The fractal starts out as a single point seed that is fixed in position. Particles float about via a random walk. Whenever a floating particle moves adjacent to fixed particle the floating particles become frozen in place. In this way, the fractal gradually grows in size.

Miscellany

Using invisible particle will make the simulation run much faster under interactive graphic terminals, especially X Windows.

Bugs

No sanity checks are performed to make sure that any of the options make sense.

Options

-widthWidth of the plot in pixels.300
-heightHeight of the plot in pixels.300
-levelsNumber of plot (gray) levels to use.256
-numNumber of floating particles.20
-stepsNumber of simulated steps.1000000
-invisInvisible particles?False
-seedRandom seed for initial state.0
-invInvert colors?False
-magMagnification factor.1
-termHow to plot points.None

diffuse.c on GitHub