Mandelbrot Set
Zoom into the Mandelbrot set: the complex numbers c for which z → z² + c, iterated from zero, never escapes to infinity. Edit the equation yourself.
One rule, z \to z^2 + c , repeated from zero, gives a shape whose detail has no end. Robert Brooks and Peter Matelski first defined and drew the set in 1978. Benoit Mandelbrot first saw it on a computer at IBM's Thomas J. Watson Research Center on March 1, 1980 and made it known; it is now a standard example of fractal geometry. The Mandelbrot set is the set of complex numbers c for which the iteration z \to z^2 + c , starting at zero, never escapes to infinity. A complex number c = x + iy , with i^2 = -1 , is a point of the plane. The set is also a catalog of the quadratic Julia sets: a value of c lies in the Mandelbrot set exactly when its Julia set is connected, that is, in one piece.
The plot samples c over the rectangle -2.5 \le x \le 1 and -1.5 \le y \le 1.5 , with up to 256 iterations for each pixel, and a spectral palette grades the points outside the set by how quickly they escape. The central body and its bulbs are the points whose orbits stay bounded up to the iteration limit. Zoom into the boundary, and notice that each level of zoom shows new filaments, small copies of the whole set, and structure that repeats itself. Mitsuhiro Shishikura proved that the boundary has Hausdorff dimension 2: by this measure of size, the boundary is as large as a surface, not as a line.
To draw the set, the plot uses the escape time method. For each pixel, take the point c = x + iy , start at z = 0 and iterate z \leftarrow z^2 + c until |z| > 2 or until a maximum number of steps. Here |z| , the modulus of z , is its distance from 0. A point that escapes is outside the set and gets a color from its step count; a point that never escapes is treated as inside and gets one color.
The escape radius is 2 because once |z| > 2 and |z| \ge |c| , |z^2 + c| \ge |z|^2 - |c| \ge |z|(|z| - 1) > |z| , so the modulus grows without bound. Both conditions hold the first time |z| > 2 : if |c| > 2 , that is the first iterate, z = c . So the whole set lies in the closed disk of radius 2.
Here the series is \operatorname{Mandelbrot}(x + iy, 256) : the built-in function iterates from z = 0 at most 256 times with the test |z|^2 > 4 . It returns 1 for the points that do not escape and, for the others, a smoothed escape count (n - \log_2\log_2|z|^2 + 4)/256 between 0 and 1, so the colors change continuously instead of in bands. When the boundary blurs at high zoom, change 256 to a larger number and notice the detail come back.
The large body is the main cardioid, the values of c for which z^2 + c has an attracting fixed point: a point that the orbit approaches and stays near. Its boundary is the curve c = e^{it}/2 - e^{2it}/4 , with the cusp at c = 1/4 and the opposite end at c = -3/4 . Attached there is the period-2 bulb, the disk of radius 1/4 centered at -1 . Much about this one equation is still not known: the boundary has dimension 2, and nobody has yet proved whether it also has an area greater than zero.
JavaScript is required to view the interactive plot.