The Math Behind the Mandelbrot Set     Click inside the rectangle below, near the boundary of the shape...
What is
maximum number of iterations:   Change the number at left to allow more lines and points (up to 1000.)

What's going on here? Well, when you pick a point (a,b) on the screen, it gets remembered and is also copied to (x,y).
Then the following steps are repeated up to 100 times.

  1. x' = x2 - y2   +  b
  2. y' =   -2xy   +   a
  3. If x' and y' are each still greater than -2, but less than 2, then:
    • draw a line from (x,y) to (x',y'),
    • set x = x' and set y = y'
    • go back to step 1 and repeat
    Otherwise stop.
You may notice that you tend to see more lines drawn when you click just inside the boundary of the shape in the picture.
If you click outside of the boundary, the lines will usually run off the screen.
The shape in the picture is the boundary of the Mandelbrot Set.

Some notes for my friends that are helping me