Thursday, June 3, 2010

The Mandlebrot Set

So I have been reading allot about fractals lately (you should start with this cool book), and of course the Everest of fractals is the Mandelbrot set. The Mandelbrot set is (for those of your who don't know) an intriguing mathematical object, but I won't go into the math of it. Just take my word for it that this set is one of the coolest things ever discovered) Visually though it has boundary that is infinitely complicated, containing myriads of twisting patterns and curves (in fact in a sense it contains every possible curve somewhere on it boundary. You can zoom in on the curve and it will remain detailed at any level of zoom, never becoming a simple shape.

I've also been wanting to try out the HTML5 canvas for a while, so I decided to make a Mandelbrot set viewer with javascript. doing something like this in a browser would have been impossible a few years ago, but now with modern browsers (this excludes Internet Explorer, sorry this wont work for you but I don't care) even computationally difficult tasks are becoming feasible using javascript.

Anyway,play around with it, maybe you get a little interested, maybe you check out some of the ideas. Maybe not.


  • Below is the Viewer (If you don't see a cool shape it probably doesn't work on your browser, you should upgrade).
  • You are going to want to zoom in on a specific spot on the boundary of the black object in the middle (which is the Mandelbrot set), to do this click and drag around the place you want to zoom in on.
  • Eventually when you zoom in too far the shape will get boring, this is simply because the computer only renders an approximation. You can increase the precision by increasing the precision value in the text box and pressing the reset button. The higher the precision the longer in takes to render the picture.
  • Pressing the reset button will also let you zoom all the way out and start exploring and new part of the set.

1 comment:

taliesin said...

That is seriously, seriously awesome. Congratulations! Can you make the zoom rectangle visible though as you drag it?