# Julia sets

Julia sets are created from the iteration of a 2D map, in this case the
analytic map z^2 + c. For each pixel of the image there is a corresponding
z value which is that pixel's location in the complex plane, or quaternion
space. For each image, a c value is chosen and the map is iterated as
follows: for each pixel, set z to the corresponding value for that pixel,
and calculate z^2 + c. This new value replaces z for the next iteration.
The calculation is done again and again, each time yielding a new z value,
but always with the same c value. Eventually, the z value will either
converge onto a periodic orbit or diverge to infinity. How long it takes
to do this is measured by the number of iterations it takes to escape a
circle of radius 2, and the number of iterations is used to color the pixel.
# Quaternions

Like complex numbers but with an extra pair of imaginary axes, the
quaternions are a further generalization of the complex field that gives up
commutativity; formally it's a division ring. A complex number can be
represented by a + b*i, a quaternion by a + b*i + c*j + d*k. Quaternions
can be added, subtracted, multiplied, etc., and in particular, the formula
z^2 + c can be iterated, but now z and c are 4-dimensional.
As an example, the fractal called 368a.gif was
created as a slice parallel to the r i plane (which is the same as the
complex plane) but .4 in the j direction and 0 in the k direction. The
constant c is (r, i, j, k) = (0.368, 0.1, 0.03, 0.01). The zoom frame is
as follows: left -0.122, right -.05, bottom 0.37, top 0.53.
For further info on quaternions, go to the library and read about them. :-)

Back to the Fractal page.