The Mandelbrot set is the set of points in the complex plane which are quasi-stable when iterated in a function. The most commonly used function is

where the complex values and are the
points being tested in the complex plane.
In practice, for each point of the complex plane we compute
until either the sum of the real and imaginary parts of
exceeds four, or the number of iterations exceeds some fixed
maximum *resolution* limit.

The stability of a single point can be computed by the following C fragment

int pixel (float zr, float zi, int resolution) { float cr = zr; float ci = zi; float zrs = 0; float zis = 0; int colour,i; for (i=0; i<resolution; i++) if (!(zrs+ zis > 4.0)) { zrs =zr *zr; zis =zi *zi; zi =2.0*zr*zi+ci; zr =zrs-zis+cr; colour =i; } return colour; }This fragment takes a couple of floating point values (

The P3l group ( susanna@di.unipi.it )

Fri Sep 8 17:29:42 METDST 1995