Mandelbrot's Fractal

Let us embark in a journey inside the magical word of fractals. The most famous is the Mandelbrot fractal. Here is an applet for exploring it:

Controls :

*Left/right click for zoom in/out.
*+/- for more/less iterations (improve accuracy)

Your browser is not Java enabled.

If it does not work, see the last section.

## What is it ?

The previous picture represents a set of points (a “fractal”), satisfying a certain mathematical condition. To each point c of the plane, we are going to apply the following function several times : $f:x \to x^2+c$. So this means for a point of coordinate $$c=(x,y)$$, we will have the sequence

$(c,c^2+c,(c^2+c)^2 +c,...)$

Now c is in the Mandelbrot set if every term of the previous sequence is bounded. In practice, we can make the bound equal to 2.

How to display such a nice picture ? With a computer program, we cannot go to infinity so we have to stop at a certain iteration, say 200. Then we can tell if every point of the screen is inside the set or not. The set should look like this :

So where did the colors come from ? In fact, they represent the number of iterations we had to do for each point. If we had to go to the maximal number of iterations, the point will be set to black. Otherwise, we will attribute a color corresponding to the iteration (you can go wild on the choice of colors !). However, if you set a low maximal number of iterations, you will see several layers of colors. each corresponding to a number of iterations (left figure).

Can we smooth the frontier between the layers ? The answer is yes, with the “Normalized Iteration Count” algorithm. Instead of associating a color directly to an iteration, we will add a term depending of the norm. If $$z_k$$ is the current point at iteration k, we will use $k'$ instead of k :

$k' = k - \frac{\frac{1}{2}\log|z_k|}{\log(2)}$

With this, you should have something like the right figure :