The Mandelbrot Set is a fractal set in the complex plain. A point c is in the set if the equation z = z2 + c does not diverge when iterated. Since the Mandelbrot Set is a fractal, it has an infinite perimeter and no matter how far it is zoomed, always has interesting features.
This program calculates and displays the Mandelbrot set using C++ and the SDL graphics library. White points are in the set, and black points are not in the set.
Because the governing equation is iterative, any pixel’s color may require hundreds of calculations to determine. The first version of the Mandelbrot Plotter took a little more than 3 minutes to plot the function entirely, with that time increasing the further zoomed the function gets. Using a few optimizations in the code, Bryson was able to decrease this base time to only about 15 seconds.
The Mandelbrot Set on its own is pretty interesting, but the images produced are more interesting and aesthetic when the points outside of the set are colored with a gradient based on how many iterations they take to reach the escape radius, or the point at which the equation is sure to diverge.
Another challenge is zooming in. Originally, when a section which does not conform the the window shape is chosen to zoom in, it was deformed obviously as shown. Bryson determined scaling equations which maintained a zoomed section’s width-height ratio regardless of the shape of the zoomed section.