First, what is a fractal? Since it is a relatively
new word to the language I had some trouble finding a dictionary
that defined it, but finally found this:
|
frac-tal (frak'tl) n. 1. a geometrical structure
that has a regular or an uneven shape repeated over all scales
of measurement and that has a dimension (frac'tal dimen sion),
determined according to definite rules, that is greater than the
spatial dimension of the structure. [< F fractale = L fract
(us) broken, uneven (see FRACTURE) + -ale - AL 2; term introduced
by French mathematician Benoit Mandelbrot (born 1924) in 1975] |
|
The particular fractal shown in the image is based
on the Mandelbrot set. I wrote the software to generate this image
myself, but this not a difficult thing to do. There have been
thousands of programs written to generate Mandelbrots and other
fractals throughout the age of computers. I've written several
myself just as something to do to relax. To generate the Mandelbrot
shown this is what I did:
Each pixel (small block of color)
in the image represents a complex number. A complex number is
a number of the form c = x + y i, where i is the
square root of negative one. For each point of the image, do the
following:
Set a variable z to zero. Repeat the following:
Replace the value of z with z2 + c. Each
time you do this, look at the absolute value of z, written
|z|. If the sequence of absolute values thus generated
converges, then the point is in the Mandelbrot set. If it diverges,
it is not.
Unfortunately, to determine whether the sequence
converges or diverges would require repeating the loop an infinite
number of times. So we cheat. It can be shown that if the absolute
value ever exceeds 2, then the sequence will diverge. So if we
ever see a value greater than 2, we can stop our loop and conclude
that the point is not in the set. Otherwise, we just repeat the
loop until we get tired of waiting, say 2000 times, and then give
up and say that the point is in the set.
By now you should be asking: "But Dave. What
about the color? If you color the points that are in the set one
color, and those that aren't in the set another color, that's
only two colors. But your image has thousands of colors."
At least you'd be asking if I haven't totally lost you.
To generate the colors we cheat again. In fact, all
the points that are in the Mandelbrot set have been painted black
in this image. And as you can see the black points are few and
far between. All the other colors represent points that are not
in the Mandelbrot set, points where the sequence of absolute values
diverged. In these cases, the color represents how quickly the
sequence diverges. To be specific the color is a representation
of how many loops were required for the absolute value to exceed
two. If it took 1078 loops, it will be one shade of green, and
if it took 1079 loops, it will be a slightly different shade of
green.
I can't remember the specifics of which portion of
the complex plane appears in this image, nor the specifics of
the color mapping, since I created this some years ago. I vaguely
recall that the image shown is for an area about a millionth of
a unit across.
In the end I used PhotoPaint, yet again, to touch up
the image for presentation here. I made a subtle change to the
hues to make it a little more pleasing to the eye, resized the
image, and converted it to JPEG format.