The
Mandelbrot Set is defined
as the set of complex numbers {z
0} which remain bounded
(i.e. stay within a specified distance from the origin, R
0)
however many times we perform the Mandelbrot map defined by:
zn+1 = zn2 + z0
For example, z
0 = 1 is not a member of the set because z
1
= 2, z
2 = 5, z
3 = 26, etc, i.e. divergent.
However, z
0 = i is a member of the set because z
1
= -1+i, z
2 = -i, etc, i.e. bounded.
The
Mandelbrot Plot is a
two-dimensional graphical representation of the Mandelbrot Set in which
points in the complex plane are coloured according to how many
iterations of the Mandelbrot map it took before divergence is
observed. It is obtained as follows:
For each point z
0 in a chosen region of the complex plane,
determine the number of iterations of the Mandelbrot map we need to
take z
0 outside a distance R
0 from the
origin. Denote this as pathLength(z
0).
Define a function Colour(q) that maps pathLength(z
0) to one
of a set of chosen colours. For example:
Define: q = pathLength(z0) / Max {pathLength(z0) }
For 0 < q < 0.2, let Colour = Red
For 0.2 ≤ q < 0.4, let Colour = Magenta
For 0.6 ≤ q < 0.8, let Colour = Blue, etc.
Thus, for each divergent point z
0 we obtain a colour which
denotes the number of iterations before it diverged. We then simply plot
these colours as a function of z
0 using our favourite
graphics package.
The following shows how the algorithm to calculate pathLength(z
0)
may be implemented in a high level computer language (C++, VisualBasic, etc.)
Set:
R
0 = 3
iterLimit = 1000
For x
0 = -5 to 5 in small increments (e.g. 0.1)
For y
0 = -5 to 5 in small increments (e.g. 0.1)
Initialise:
x=x
0
y=y
0
iterCount = 0
hasDiverged = false
While hasDiverged = false and iterCount < iterLimit
Add 1 to iterCount
Set:
a = x
b = y
Calculate:
x = a
2 - b
2 + x
0
y = (2 × a × b) + y
0
r = √(x
2 + y
2)
If r > R
0 Then
Set:
hasDiverged = true
pathLength(x0, y0) = iterCount
End if
End while
Next y
0
Next x
0
To view the Mandelbrot plot at higher levels of magnification,
select a region near to fractal boundaries (i.e. areas where there are
abrupt changes in colour) and using, a smaller scale, repeat the process.
Do this over and over again to zoom in and see the rich
complexity of the Mandelbrot set.
An interesting variant on the Mandelbrot plot is the
Buddhabrot,
so called because it resembles the traditional image of Buddha.
© James Travers 2012