# How the Formula is Used

The formula used by the Complex Number Fractal Generator can be thought of as a function f(z, c). It is used to transform z, like so:

zn + 1 = f(zn, c)

and is iterated until the modulus (absolute value or size) of z is greater than 2. The point is then coloured according to how many iterations it took to escape. This part of the routine is common to both Mandelbrot Sets and Julia Sets. The diference is in the definitions of c and z. In a Mandelbrot Set, the initial value of z is 0, and the initial value of c is the point on the complex plane, while in a julia set, z's initial value is the point on the complex plane and c is some constant. This means that there is only one Mandelbrot Set for a formula, while there is an infinite number of Julia Sets. In fact, each value of c for a Julia Set, corresponds to a point on the Mandelbrot Set. Points that are inside the Mandelbrot Set (the black bit) will give connected Julia Sets, while points outside will give disconnected sets, and points on the edge (eg. 0 + 1i) will give Julia Sets with no area.

Some formulas for implemented fractals are:

 Mandel: f(z, c) = z2 + c Mandel3: f(z, c) = z3 + c Mandel4: f(z, c) = z4 + c