# Mandelbrot Math

## Introduction

The mandelbrot set is a 2-dimensional fractal structure which was discovered by Benoit B. Mandelbrot. A fractal is a mathematical object which posesses the property of self-similarity if you magnify a certain portion of it. The self-similarity of the mandelbrot is not exact but rather perturbs the deeper you zoom but the inner lake of it can be found at any scale with exactly the same form.

## The Formula

The formula is zk+1=zk2+c where the zk and c are complex numbers. Written for real numbers this formula yields the two terms

xk+1=xk2-yk2+cx
yk+1=2xkyk+cy.

We define z0=0 and define c to be any coordinate. This formula defines a sequence of complex numbers which can be interpreted as a sequence of 2-dimensional coordinates. If |zk| is bounded (i.e.: if the distance of the coordinate keeps finite) the point at c is called to belong to the mandelbrot set. There is no finite test wether |zk| is bounded but the opposite can be tested in finite steps for a particular point c: If |zk|>4 for some depth k then the coordinate goes to infinity. This happens to all points outside the mandelbrot set for some depth k. But we do not know when it happens. In fact this depth grows infinitely if the coordinate approximates the border of the set. Conclusion: Using this criteria we may find out if a point does not belong to the mandelbrot set but if it lies inside we can never be sure.

## The image

Now again - How to generate the image? In simple Steps please...

``````
Constant Unsigned Integer MAXX=600, MAXY=800, MAXITER=500
Complex z,c
Unsigned Integer x, y, i
y = 0; while (y < MAXY) do
x = 0; while (x < MAXX) do
c = ( x / MAXX * (4-(-4)) + (-4), y / MAXY * (4-(-4)) + (-4) )
Creates a complex number where each (x,y) is mapped to
the area (-4..4,-4..4).

z = 0
i = 0; while ( i < MAXITER and |z| < 4 ) do
z = z*z + c
i = i+1
setPixel( x,y,MAXITER-i )
This way the points inside the set are always of
color 0 while the points outside a circle of radius
4 are always of color MAXITER.

x = x+1
y = y+1
``````

Compared to the methods applied in current fractal viewers this is a rather slow approach. The applied methods of optimization usually try to save calculation of the inner loop by the fact that large portions of the image have the same color. Subsequential orthogonal area subdivison is called tesseral method in fractint. If sampling using a grid is done, the areas surrounded by pixels with the same color may be omitted and colored uniformly (called guessing). I also have seen a technique called tunneling which is based on the assumption, that most of the calculation time is spent on the internal lakes. If an internal point is encountered a binary search method is performed to find the next point outside the set. The most beautiful method is boundary trace. Using a triangulation the boundaries of a lake are tracked and the resulting areas are assumed to be of equal depth. The problem of all these techniques is that they sometimes generate wrong results, missing some details.

## Deeper Math

Of course:The formulas stated so far are not all the mathematicians have found out. There is a co-fractal called julia set. It is generated by using a fixed value c (the parameter) for the whole image and initializing z with the pixel coordinate. For every point c inside the internal mandelbrot lake the resulting julia set is connected, which means it has an internal lake. For every coordinate c outside the mandelbrot set it is disconnected, which means all structure is on islands. There exists an infinite number of points m in whose neighbourhood the julia with parameter m and the mandel are approximately equal. These points are called Misiurewicz points and are dense on the border of the mandelbrot set. under this perspective the mandelbrot set can be viewed as catalogue of julia sets.

## More to come...

Actually this text is a kludge. I intend to write more stuff about it, but i haven't done it yet. I hope that your most urgent desire for information about Mandelbrot fractals was fulfilled this far.

## Appendix: Complex Numbers

subtraction (a,b)-(c,d) = (a-b,c-d)
division
 (a,b) (c,d)
=
 ac+bd bc-ad ( , ) c2+d2 c2+d2
square absolute |(a,b)|2 = a2+b2
square (a,b)2 = (a2-b2,2ab)
Complex numbers z are defined as pairs of real numbers (x,y) and can be written in a single sum using the imaginary unit i: z=x+iy. The constant i is defined as the square root of 1 or, in other words, i2=-1. Using a sheet of paper the arithmetical operations +,-,* can easily be derived from the sum representation (see table). For the derivation of the division expand the numerator by c2+d2. The absolute value can be computed by calculating the square root of |(a,b)|2.

back to:
 Figura Fractal Roberts Homepage
mailto: Robert Figura