home page
book reviewspalmpilotgraphicsCV (Resume)MR2journalslinksitems wanted and for salewaht's new on this sitehobbies and interests
The following is taken from my article in Archimedes World magazine in July 1991. It is only slightly modified.
 

The Mandelbrot set.

 Ever since Benoit Mandelbrot explored the fractal geometry of nature, fractals have been the target of a huge amount of research. The Mandelbrot set, or Mset, in particular, has become extremely well known and reproduced in any number of different forms. This is largely because of the infinite variety of patterns, and immense beauty, that can be derived from one simple equation.Interestingly enough the set is not strictly fractal since it has a Hausdorff Dimension of exactly 2.0 - not a fractional dimension at all. However, there is no denying that it is fractal in nature.

 Let's first start with complex numbers. A complex number consists of two parts, a real and an imaginary part, and usually takes the form

                   a + bi

where  a  and  b  are constants and  i  is the square root of  -1, (an imaginary number).

 The argand diagram is a means of displaying complex numbers, and has two axis (the real axis and the imaginary axis). A complex number such as a + bi is plotted on the Argand diagram by moving  a  units along the horizontal (real) axis and  b  units along the vertical (imaginary) axis. The mandelbrot set is an argand diagram, with all the complex numbers plotted in a colour according to how they behave in a particular equation.

 The equation is

                                  2
                       X      =  X   +  c
                        n+1       n

 where X  is zero and  c  is a complex number.
        1

Successive iterations of this equation are applied.

                        2
                 X   = X   + c  = 0 + c  =  c
                  2     1

                        2          2
                 X   = X   + c  = c  + c
                  3     2

                        2           2     2
                 X   = X   + c  = (c  + c)   + c
                  4     3
                                   4      3    2
                                = c  +  2c  + c  + c

                  .... etc etc.

The process is stopped when  Xn  reaches a certain value in which case the colour used to plot c on the Argand diagram is the number of iterations made, or when a certain number of iterations have been made, in whch case a 'background' colour is used to plot c. In this program, the background colour is black. In actual fact it is not Xn that is used to determine whether the iterative process should stop but the square of the modulus of Xn, and the iterations stop when this value becomes greater than 4.

if Xn = a + bi

          2                      2    2
      |X |    =  (a+bi)(a-bi) = a  + b
        n

The computer has no concept of an imaginary number so all calculations are done by splitting complex numbers into their two (real and imaginary) parts.

addition         x + yi = a + bi  +  c + di

        so   x = a + c   and    y = b + d

multiplication   x + yi = (a + bi)(c + di)
                                              2
                        = ac + bci + adi + bdi
                                                       2
                        = ac + (bc + ad)i - bd       (i  = -1)

        so    x = ac - bd  and   y = bc + ad

in the case of squaring

                 x + yi = (a + bi)(a + bi)

                           2            2
                        = a   + 2abi - b

                    2    2
        so     x = a  - b     and  y = 2ab
 

Now we have the information necessary to let the computer handle the work.We take successive pixels from the screen corresponding to points on an Argand diagram (these are the values for c). We apply the iterative equation above, and plot our pixel on the screen in a colour corresponding to the number of iterations made.
 
 

 
Top  ¦  Home  ¦  Ray Tracing  ¦  Fractals  ¦  CV  ¦  Interests  ¦  PalmPilot  ¦  Journals  ¦  For Sale
Last updated 26 March 1998  ¦  Fave Links  ¦  contact me