The Programmer's Guide to Fractals
Written by Mike James
Thursday, 18 July 2019
Article Index
The Programmer's Guide to Fractals
Fractal Dimension
Julia Sets

## Julia sets

There is a near relation of the Mandelbrot set that has close relationships to complexity and stability theory.

If instead of testing different values of c in the iteration we fix c and try out different initial values of z then the set of points that don’t go off to infinity is called the Julia set - named after Gaston Maurice Julia, a French mathematician who really started the whole subject of fractals off in 1918.

He did most of his maths while recovering from an injury that resulted in the loss of his nose during the First World War. At the time his ideas were received with much interest and excitement but they were then forgotten until Mandelbrot rediscovered them in the 1970s.

Gaston Julia (1893 - 1978)
the man who really started fractal theory

So to be clear a Julia set corresponding to c is the set of points z that don’t go off to infinity when repeatedly transformed using:

`z<- x2-y2+a+i(2xy+b)`

You should be able to see that there is a Julia set corresponding to each point in the picture of the Mandelbrot set. Indeed the shape of the Julia set changes depending on whether or not the point is inside, outside or on the boundary of the Mandelbrot set.

You can create a very nice movie by displaying the Julia set corresponding to a point in the Mandelbrot set and then slowly moving along a line until the point crosses the boundary of the set.

## Practical value?

So what is the practical value of fractals?

One answer is that practical value isn’t really what matters here and the ideas are worth studying anyway.

However, there are some practical uses.

You can generate fractal sets using a different sort of iteration. An affine transformation on the plane is some combination of scaling, rotation and translation. If you pick such a transformation and repeat it on a starting set the results can be as surprising as anything seen in the Mandelbrot set. Each transformation rotates and shears the set in a way that mixes up the points in what look like increasingly violent ways. However if you choose the right transformations things turn out to have more structure than you might expect.

For example, with the correct starting set and the correct affine transformation the result of iteration is something that looks like a fern, a tree or a mountain range. Natural shapes seem to have fractal characteristics and fractals using iterated affine transformations have been used to create realistic-looking but artificial 3D plants and scenery.

If you can generate a natural lifelike looking shape using the right starting set and the right affine transformation, why not try using the same trick to compress images. To compress a picture you simply have to analyse it to find the starting set and the transformation that creates it from the starting set. As the number of parameters in the transformation and the starting set are far fewer than the number of pixels in the image, the compression factors achieved can be very large.

The problem with fractal compression is that it is hard work to find the transformation given a picture. In practice JPEG compression seems to be easier to use but this doesn’t mean that fractal compression couldn’t be useful in some cases.

You can find out more about fractals, and the Mandelbrot and Julia sets in particular, by downloading one of the many fractal explorer programs available on the web.

## A Programmers Guide To Theory - NP & Co-NP

*To be revised

#### Related Articles

Fun with fractal squiggles

Fractal Image Compression

Benoit Mandelbrot, the father of Fractal Geometry, dies

Looking at Chaos