Last essential modification: March 24, 1999

Fractals became popular in the 1980s, when microcomputers started to become common. Everyone could produce the Mandelbrot set with their home computer. It is difficult to conceive how so simple mathematic formulae can create such beautiful images having such detailed and in some sense recursive structure.

The underlying mathematics makes use of complex numbers. For each
point `c=t+j x` n the complex plane, one associates a colour
by using an iterative process:

z_{(0)}=0

z_{(i+1)}=z_{(i)}²+c

The colour of the point `c` is the smallest `i` for
which `|z _{(i)}| > 2`.

This is the process for the Mandelbrot set. The Julia set is similar, but it uses the formulae

z_{(0)}=c

z_{(i+1)}=z_{(i)}²+d

Above, `d` is an additional parameter, which is used for
all points in the fractal.

Programming languages usually do not directly support complex number arithmetics. Therefore, the iteration equations are usually split into real and imaginary components

z_{(i)}=t_{(i)}+j x_{(i)}

c_{(i)}=ct_{(i)}+j cx_{(i)}

and the iteration step is as follows:

t_{(i+1)}=t_{(i)}²-x_{(i)}²+ct

x_{(i+1)}=2 t_{(i)}x_{(i)}+cx

This can be generalized to 3 dimensions by adding another
coordinate `y`, which is orthogonal to both the `t`
and `x` axes:

t_{(i+1)}=t_{(i)}²-x_{(i)}²-y_{(i)}²+ct

x_{(i+1)}=2 t_{(i)}x_{(i)}+cx

y_{(i+1)}=2 t_{(i)}y_{(i)}+cy

These formulae were originally found out by my friend Topi Kärki,
who wanted to see how the Mandelbrot fractal behaves when using
quarternions instead of complex numbers. It turned out that the
4^{th} dimension was redundant.

I wrote a Java applet that calculates 3-dimensional Mandelbrot and
Julia fractals. As a bonus I added a Mandelbrot variant that makes
use of the Julia parameters. Instead of initializing
`z _{(0)}=0` it sets

Please do not expect the program to display any fancy rotating
objects. It merely projects the 3-dimensional fractal on the
`tx` plane, cutting 2-dimensional slices of it. You can view
the `y` parameters as height coordinates.

There are two versions of the applet. The JDK 1.0 version should run on all Java implementations. Due to the limitations of JDK 1.0, resizing the window does not work as expected. The JDK 1.1 version reacts to resizing as expected, but it does not work in Netscape Navigator version 3.

The applet consists of 4 classes. You may use, modify and redistribute the software under the conditions of the GNU General Public License.

`Viewer`

- The applet class, derived from
`java.awt.Applet`

- In the JDK 1.0 version,
this class is called
`Viewer10`

. `Fractal`

- The fractal class, derived from
`java.awt.Canvas`

- In the JDK 1.0 version,
this class is called
`Fractal10`

. `DoubleField`

- Entry field for double-precision floating point numbers, derived
from
`java.awt.TextField`

`IntegerField`

- Entry field for integer numbers, derived from
`java.awt.TextField`