This section provides a brief, non-technical introduction to the mathematics of the Mandelbrot set.
The Mandelbrot set is generated from the iteration of the function z * Z + c , where c is a complex constant. At the first iteration, z is given a value of zero. For each subsequent iteration, the result of the previous iteration is used for z. Refer to Example 4-1 to see the iteration of this function expressed in Fortran.
If a sufficient number of iterations are done, one of two possible results will be seen for each value of c:
The Mandelbrot set is defined as those values of c for which the value of the function does not tend to infinity.
The Mandelbrot set is customarily plotted on a grid representing the complex plane. In practical terms, the way this is usually done is based on the way Benoit Mandelbrot first visualized the set back in 1979: Each pixel of a computer monitor represents a point on the grid. The pixel is colored in (white, or some other color) if that point is proven to be outside of the set. The pixels that remain black (not colored in) represent an approximation of the Mandelbrot set.
You may notice that the definition of the Mandelbrot set is phrased in negative terms: the set consists of points on the complex plane (i.e. values of c) which do not tend to infinity. For many points, the value of the function will seem to vary within some range for a large number of iterations, before escalating suddenly and diverging to infinity.
If the function does not tend to infinity after a given number of iterations, there is frequently no way to know whether it would diverge if additional iterations were performed. No matter how many iterations are performed, any visualization of the Mandelbrot set will inevitably include some points that would have diverged if still more iterations were performed. Therefore, all visualizations of the Mandelbrot set are approximations that overestimate the size of the set. As the number of iterations is increased, the image of the Mandelbrot set gradually shrinks toward a more accurate shape.
It turns out that testing whether a point is in the Mandelbrot set yields important information even if that point is found to be outside of the set. A great deal of information can be gained by studying the electrostatic potential the set creates in the region outside of the set.
In concrete terms, imagine a metal pipe of very large diameter standing up on end. Standing up in the middle of this pipe, imagine a very thin stick-like object with the same length as the pipe, having the unusual property that its cross-section is shaped like the Mandelbrot set. If the stick is given a potential of zero, and the pipe is given a high potential, an electrical field will be created in the region between the stick and the pipe.
When the diameter of the pipe is increased to infinity, then a plane cutting horizontally through this system will represent the complex plane with the Mandelbrot set at its center. The infinite region containing the electrical field is the complement of the Mandelbrot set.
Equipotential lines, which are lines connecting points of equal potential, can be drawn in the Mandelbrot complement region of this horizontal plane. These lines form a series of concentric rings, which are near-perfect circles at great distances from the origin, and increasingly distorted and twisted closer to the Mandelbrot set region. These equipotential lines, and the field lines that cross them at right angles, give a large amount of information about the shape and other characteristics of the Mandelbrot set.
A remarkable mathematical property of this system is that the potential of any point in the Mandelbrot complement set is a simple function of its escape time. Escape time is defined as the number of iterations needed for the value of the Mandelbrot function to escape beyond a circle of some (arbitrary) large radius centered at the origin. Since the entire Mandelbrot set lies inside the circle of radius 2, any radius greater than or equal to 2 can be used. However, the larger the radius, the more accurate the approximation of the Mandelbrot complement set.
Put simply, the potential of a point in the Mandelbrot complement set is measured by how quickly the value diverges toward infinity.