Wednesday, March 14, 2007

Mandelbrot Fractal Flash

You can see the Fractal using this flash movie.

One of the first pieces of code I programmed when learning how to program using Microsoft Foundation Classes was the Mandelbrot fractal. I directly colored pixels, using distance for points still inside the fractal space, and using "generation" to color pixels outside the fractal space. My father helped choose the color scheme. I then coded the program to reshape where we were looking in the complex number field with a pair of mouse clicks, and added a keyboard "zoom out" control. Running time can be long for large images, but that helps them turn out beautifully. The complex math was programmed into a pure C++ object, with as little mixing with MFC as possible.

No comments: