I've tried getting into fractals-- and I mean the cool ones on the complex plane, not the Menger sponge or L-systems... they're more-or-less trivial. A fractal is an infinitely-complicated picture generated by a mathematical function. I'm starting with the Mandelbrot set because it seems to be the starting point for everything. Also, its much easier to find documentation for Mandelbrot than many other similar fractals... though the "burning ship" is second on the list. Also, I was surprised how, after a little schooling (and I still can't find my Discrete Structures book... think my dad lost it), the stupid notation melted away and everything made sense. Here's a brief tutorial on the Mandelbrot set:

The first part of the formal definition states: P_{c} : *z* → *z*^{2} + *c*.

It is iterated with *z* starting at 0. In fact, it might make more sense to think of it as a recurrence relation. But, in the rather silly ways that mathematicians misuse notation, they write the *n*th iterate of P_{c} P^{n}_{c} -- The sheer amount of HTML markup that goes into these things is quickly becoming ludicrous. So, that's **not** P_{c} raised to any power... it's an iteration. If you think of it as a function, it's akin to f( f( f( ... 0 ) ) ... ) where the function is nested *n* times. Also, *z* is a complex number, so it has a real part and an imaginary part.

The next part says M = { *c* ∈ **C** : ∃ *s* ∈ **R**, ∀*n* ∈ **N**, | P_{c}^{n}(0) | ≤ *s*}

Lots of notation, but most if it is just defining the variables. Translated: "M is the set of complex *c*s such that there exists a real *s* and for all natural *n*s, the absolute value of our P function is less than or equal s." It says *c* is complex and *s* is real. There's only one *s* that this mess works for– usually taken to be 2. *n* is taken to be our iterating variable, so it's naturally a natural number (a counting number– an integer greater than zero).

"Mark! How does this make a cool picture?" you finally ask, throwing your hands up. "We want the cool picture."

Okay! Hang on! So far, I've skirted the point, but the Mandelbrot set is actually a **set**. We'll make a picture coloring black (traditionally) all the points that are in the set, and ... we'll get to the other colors in a second.

"How are they plotted?"

Well, we're talking complex numbers. Complex numbers have two parts, a real part and an imaginary part. The real part of the number becomes the traditional *x*-axis and the imaginary part is the *y*. Wikipedia tells me that the real part ranges from -2.5 to 1 and the imaginary part ranges from -1 to 1. So, for our P_{c}, we let *z* start at -2.5 - 1*i*, and try every value up to 1 + 1*i*. With each trial, if it falls into the set, we color it black, like I said before. If it's not, well... we're not going to actually try every natural number, since there are an infinite number of them. Instead, after we give up (a thousand iterations or so), we'll see just how far many iterations it takes to leave the value of *s*– this is why I wanted to save this for now.

When we do our function above, we're going to get a number that's either part of the set, that is |P_{c}^{n}| ≤ *s*, or we won't. If it isn't, that is |P_{c}^{n}| > *s*, how many iterations did it take for P_{c}^{n} to escape *s*? This number can be mapped to a color, usually a simple color-gradient.

And there's more than just the Mandelbrot set... if instead of setting your P_{c}^{n} to *z*^{2} + c, and instead separate *c* into its real and imaginary parts before squaring, you get the dazzling burning ship fractal. The formal definition for that would be more like P_{c} : *z* → ( | ℜ(*z*) | + |ℑ(*z*)| ) ^{2} + *c*.

The fancy R and I just mean "take the real/imaginary part of the number in parentheses". So, it's more or less the same as before...

Anyway, I'm sharing all this because fractals are a sort of whimsical structures, and math, according to a good lot of people, is "hard" or "boring"... and this proves sort of the opposite. It's the opposite of boring. You've generated a picture of infinite complexity! No matter how close you look, there's something more to see! And it's really not hard. If you look past the cruddy notation and weird symbols and try to see what it's **trying** to say, it's relatively simple.

I wrote the source code to generate these fractals using Java, but there is no built-in class for complex numbers. The idea is that you can use simple algebra to get through iterating complex numbers by separating each number into its real and imaginary component. Since Mandelbrot's set and the Burning Ship fractal are very similar, the source code is equally similar.

- Mandelbrot.java: Source code for the Mandelbrot set.
- Mandelbrot.jar: The executable program that lets you zoom into the Mandelbrot fractal.
- BurningShip.java: Source code for generating the Burning Ship fractal.
- BurningShip.jar: The executable program for zooming into the Burning Ship.

To use the above programs, click and drag boxes to zoom into. You may
use the **f** key to toggle full-screen mode, and **s** to save a
screenshot. Also, **,** and **.** (comma and period) rotate the
color map.

So, I hope something's been learned here. Complex numbers aren't really complex, despite their name. Programming stuff like this can be fun and rewarding. Now, you can go back home!