Using G & G with Fractals

Last update=16 May, 2006


Fractal Window

Above is a typical fractal window containing a detail of the Mandelbrot set. A fractal window shows a region of the complex plane. Two kinds of fractals are available -- the Mandelbrot set, and Julia sets. Fractals are constructed by iterating a function g(C,Z), where Z is a complex variable, and C is a complex constant, eg. g(C,Z) = Z*Z + C is a typical iterator.

Given a starting value Z_0, we iterate

      Z_{n+1} = g(C,Z_n).

If |Z_n| --> infinity, we say that Z_0 is in the escape set. If |Z_n| is bounded, we say that Z_0 is in the prisoner set. The Julia set of the iteration g(C,Z) is the boundary of the prisoner set.

A fractal window corresponds to a region of the complex plane. Each pixel in the window corresponds to point in the complex plane. The algorithm for computing Julia sets is basically the following.

for each pixel in the window do begin
    Z_0 = complex value corresponding to the pixel
    nIterations = 0
    Z = Z_0    // starting value
    while |Z|<MaxModulus and nIterations<MaxIterations do
        Z = g(C,Z)
    end    // while
    if |Z|<MaxModulus begin
        // assume that Z_0 is in the prisoner set
        colour this pixel black
    else begin
        // assume that Z_0 is in the escape set
        assign a colour to this pixel
end    // for

G&G currently uses MaxModulus = 5, and MaxIterations = 50. The Mandelbrot set is computed by a similar loop, except that the iterations always start at Z_0=0, and C is varied over the region of the complex plane in the window. The iterator for the Mandelbrot set is g(C,Z) = Z*Z + C.

There is no guarantee that the fractals computed are correct!

In the article "Computing over the reals: foundations for scientific computing", by Braverman and Cook, AMS Notices, March, 2006, it is indicated that the Mandelbrot set may not be computable, in which case all programs that compute it have some incorrect pixels.

G&G computes the Mandelbrot set, and also Julia sets for about 10 different iterators g(C,Z).


Fractal Functions Available in G&G 3.2


Click anywhere in a fractal window to zoom in. The location of the click determines the new centre of the window. Shift-click to zoom out. As the window is zoomed more and more, G&G increases MaxIterations, as more resolution is required. This will result in longer times to re-compute the fractal.

Change C

Use the arrow keys to move about in the complex plane. The right/left keys change the real part of C. The up/down keys change the imaginary part. The basic change to C is 0.1 for each keypress. Hold the shift key to change by 0.01. Hold the option key for 0.001. Hold both shift and option for 0.0001.


G&G     Back to the Groups & Graphs home page.