Mandelbrot Fractal

this should be a java applet.


  • Click and drag a rectangle to zoom.
  • To return to the initial position just click (and release) without dragging a rectangle.

Source code

You can look at the source code if you want, but I warn you it is quite hacked and completely uncommented. (Due to the applet needing to be less than 4K).

The Mandelbrot set

This applet represents the mandlebrot set. Each point is coloured based on the following formula:

zn+1 = zn2 + z0

z = x + iy (a complex number)

Starting with the initial conditions (z0), we iterate through the equation until the size of zn reaches some value, or we decide to stop iterating. So for example, in this applet, we run through the equation for a maximum of 128 times or until zn is greater than 21/2 (root 2). Then take the number of iterations we ran through (between 1 and 128) and use this to colour the point on screen.

This applet should work fine in any java1.1 compatible browser and should at least draw the initial picture in a java1.0 browser (with the zoom disabled). However it does not seem to work at all using Netscape 4.7 on the Apple Mac, but it does work using Internet Explorer, because it uses Apples MRJ.