What is the Mandelbrot set?

$z_{n+1} = z_n^2 + c$
This formula is the essence of this generated fractal. But where do the colors come from? And how do we generate it?
Let us explore this wonderful beauty in this exploratory website. Buckle your seatbelts and scroll down!
Note: Please use Firefox for the best experience (Chrome doesn't render MathML symbols properly)

How do we start?

Let us see how we get from $z_0$ to $z_1$. Our mouse determines the c, a complex number. This also is our $z_0$, the starting point of our iteration. So $z_0 = c$. Now according to our formula, $z_1 = z_0^2 + c$. We visualized $z_0 = c$, $z_0^2$ and $z_1$, so you can get a feeling for what is going on.

What happens if we continue the iteration?

Now that we know how to start the iteration, lets see what happens when we continue it. Now we visualize not only $z_0$ and $z_1$ but all $z_i$ until $i=50$. See how some points $c$ seem to let the equation escape to infinity.

But where does the color come from?

As you saw, some points escape to infinity, others tend to stay around the unit circle.
Now, let's color every point $c$ according to how long it takes for the equation to escape to infinity.
That's how we generate this beautiful fractal.
The Mandelbrot Set contains all the points that don't diverge. They are typically drawn as black.
So the colors you see in the image are points that go to infinity at different speeds.
As a little sidenote, how we determine if a point escapes to infinity is pretty simple. If the magnitude of a point $z_n$ is greater then 2, we know it goes to infinity. A rigorous proof can be found here.
As an intuitive explanation you can think of $\vert z_{n+1}\vert > \vert z_n \vert^2 - \vert c \vert$ for $\vert c \vert < 2$ and $\vert z_n \vert > 2$. So if the magnitude of z_n only increases, the point must diverge.

Now enjoy exploring!

You will discover another fascinating thing about the Mandelbrot set when you zoom in.
In theory, you can draw the fractal as deep as you want. On this website it's only possible to zoom in, until we reach the floating point accuracy.
But nonetheless this will be an awesome adventure.
To zoom in, click and drag your mouse over the area you want to inspect. To zoom out, press middle click. To restart, press right click