Return to Snippet

Revision: 15440
at July 6, 2009 07:45 by hasantayyar


Initial Code
For each pixel on the screen do:
{
  x0 = x co-ordinate of pixel
  y0 = y co-ordinate of pixel

  x = 0
  y = 0

  iteration = 0
  max_iteration = 1000
 
  while ( x*x   y*y <= (2*2)  AND  iteration < max_iteration ) 
  {
    xtemp = x*x - y*y   x0
    y = 2*x*y   y0

    x = xtemp

    iteration = iteration   1
  }
 
  if ( iteration == max_iteration ) 
  then 
    color = black
  else 
    color = iteration

  plot(x0,y0,color)
}

Initial URL
http://en.wikipedia.org/wiki/Mandelbrot_set

Initial Description


Initial Title
Mandelbrot set (pseudocode)

Initial Tags


Initial Language
Other