Pages

Wednesday 30 September 2009

More Emergence - The Mandelbrot Set


The image to the right is one amazing example of emergence. It is the fractal pattern known as the Mandelbrot Set, named after the mathematician BenoƮt Mandelbrot.

The rules that govern the Mandelbrot set are very simple - anyone with a basic understanding of complex number theory should be able to make it work. Understanding why, and how it works is a much harder question, and something that I won't go into. I'm just here to make some pretty pictures!

So how does the mandelbrot set work? Imagine the image to the right is made up of points, set co-ordinates. Each point is described by one number which tells us where it lies vertically, and another which tells us where it lies horizontally. Mandelbrot mapped the vertical location to imaginary space, and the horizontal location to real space - in other words he mapped the co-ordinates to complex space (for mathematicians out there - a pixel is pretty much equivalent to a point on an Argand diagram).

Complex space is made up of complex numbers of the form a + ib, where a and b are both real numbers.

We can calculate the square of a complex number using:

 (a + ib).(a + ib) = a*a - b*b + 2iab

The real component of the new number is now (a*a-b*b), and the imaginary component is 2ab.

The Mandelbrot set arrises when the number of iterations for the value of a*a+b*b is calculated to be greater than some threshold value for each pixel. The colour variation you see on the diagram depends on the number of iterations for the prior calculation for that particular starting number.


For lower iterations the detail in the image does not appear as much. Where as for higher iterations (the demo below is set to 500 iterations per pixel) the detail achieved will be far greater.

One issue arrises in the way that computers - in this case flash - handles numbers. Floating point numbers will not achieve the required accuracy when the amount of zoom on the graph is too high. Unfortunately this results in an infinite amount of zoom being impossible on this platform.


Just click on the image to the right to launch the mandelbrot set program. Enjoy it, and have a play around going down several routes. To the left of the main cardioid bulb is a region dubbed seahorse valley. It is one of my favourites!

For some more interesting articles on the Mandelbrot Set and some incredible zooms visit:

University of Utah

Mandelbrotset.net

Enjoy!

No comments:

Post a Comment