Fractal Theory: The Mandelbrot Set
So that brings us to today. The Mandelbrot set is found in the complex plane. Each point on that plane represents a single complex number of the form a + bi, where a is the distance left or right from the center line (negative when left, positive when right) and b is the distance above or below the center line (negative when below, positive when above) and i is the root of -1.
With the understanding we now have of complex math, we can write out the Mandelbrot formula in a much more compact form. If we had a computer language that understood complex numbers (some do), we could even write a program in the following form:
Z = (0 + 0i)
C = (a + bi)
for (counter = 0; ABS(Z) <= 2.0 && counter < MaxIters; counter++)
Z = Z * Z + C;
That's it. The Mandelbrot set is really simple. All the lines of code at the beginning of this discussion were just teaching the computer how to do the single line of math above. Multiply Z by itself. Add C. The answer is the new value for Z. Repeat until the absolute value of Z is greater than two, or until our counter expires.
The only unexplained feature above is the ABS(Z) part. ABS stands for absolute value. The absolute value of a complex number is simply its distance from the center of the plane. If we think of the number as a point on the plane, we can measure the distance from the center with a ruler. Or, that distance can be calculated (because it's simple to create a right-angle triangle on a plane) by determining the square root of a squared plus b squared. If the answer is less than or equal to two, you are looking at a point in a Mandelbrot set. If the answer is greater than two, the point is outside the set.