| Weblogs | Pictures | Technical | Other |
| Personal [RSS] | Dreams [RSS] | Technical [RSS] | |||
| General | Geocaching | |||
| Software | Misc Code | Fractals | |||
| DVDs | Equipment | Links | |||
I've always been curious about fractals, and recently I've spent the time necessary to be familiar with the basics of fractals. You don't need to be a geek, a mathematics God, or a computer programmer to appeciate the beauty of fractal images. This section of my personal website is split into two distinct subsections: a gallery of beautiful and interesting fractal images for your viewing pleasure, and a technical section describing the theroy of fractals and linking to some simple software I've created to generate fractal images.
![]() |
![]() |
![]() |
This description of fractals will be limited to the two most common, popular, and simplest fractals: the Mandelbrot and Julia set. The theroy behind these fractals is applicable to other fractal sets, though.
A fractal is a set of complex numbers. Which numbers are part of the set is determined by an iterative function which must be evaluated for an infinite number of iterations at every complex number. Gee, it sounds like that would take a long time. The Mandelbrot and Julia sets are defined by the equation zn+1 = zn2 + c. z and c are both complex numbers.
Pictured above is a mandelbrot set image. An image? Yes, an image. How did you go from math to a picture? Ah, good question. First, back to math for just one more second. It is important to remember that in a Mandelbrot set, z0 = 0 + 0i. It can be set as c, actually, but this doesn't apply to a Julia set quite the same way. Ok, so, that's the math. How does that math turn into an image? First of all, the image is actually plotted on the complex plane. For each complex number (a + bi), the real number (a) is used as the x coordinate, and the imaginary number (b) is used as the y coordinate.
Remember I said that determining which numbers are part of the Mandelbrot set would require iterating through our function an infinite number of times at every complex number? I meant it. However, to determine which numbers are not part of the Mandelbrot set is a bit easier. (Thank Root.) For every complex number, iterating the Mandelbrot equation will do one of two things: diverge, or not. To 'diverge' means that the answer zn will move further away from 0 + 0i (the origin of the complex plane) as n increases. You can tell whether the sequence is diverging based upon how large the absolute value of zn is. If it is greater than the square root of 5 (2.23606797749979), the sequence is said to be diverging at the point c.
Getting closer to an image, I swear. :) You now know how to figure out if a point on the complex plane is not part of a Mandelbrot set. If it diverges, it is not part of the set. We can take this information and create an image out of it. Decide on the size of image you'd like, and then a range on the complex plane (the Mandelbrot set appears between -2 + -1i and 1 + 1i). Interpolate a point on the complex plane for every pixel in your image. Iterate through the Mandelbrot function for that point until it diverges, and record the number of times that you had to iterate before you were sure it diverged (the absolute value became > 2.24). You can now use the number of iterations required before it diverged to colour that pixel in your image! You can colour it any way you choose. Here's where art means math. If the sequence never diverges after an infinite number of iterations, that point is actually a part of the Mandelbrot set and can be coloured based upon that information.
Wait a minute. After an infinite number of iterations? Well, maybe not. If you're creating an image, you probably don't want to wait that long. Choose a number for the maximum number of iterations. 80, 100, somewhere around there. A higher number of iterations will give you greater resolution (because if you only do 80 iterations, you only have 80 possible colours), but will take longer, and sometimes isn't necessary at all. If you hit the maximum number of iterations, that point is considered to be part of the set. Close enough, eh?
You can play around with different coordinates and resolutions with my Mandelbrot fractal generator. Whee ha!
The Julia fractal set is very much like the Mandelbrot set. In the Mandelbrot set, the equation zn+1 = zn2 + c was used to describe the set. The same equation is used for the Julia fractal set, but with two differences. The c variable is constant, it is not the point you are iterating for. z0 is not 0 + 0i, it is the point you are iterating for. Whether c is part of the Mandelbrot set or not will determine whether the Julia fractal is connected or not. A connected and a non-connected Julia fractal produce significantly different images. Varying the point c will also produce a different image each time.