Introduction to Fractals

In this lab you will implement the infamous Mandelbrot fractal. Though the application of a very simple rule, you will see how it is possible to create intricate and complex geometry of infinite detail with minimal effort.

Download the starter code here and the accompanying document here. You will need to implement the Mandelbrot fractal as discussed in the document.

As a first step, you will need to visualize the Mandelbrot set. If a point is within the Mandelbrot set, you should color the pixel black; otherwise, white. Below is what your result should look like.

Once you've reached this stage, you'll want to choose a color for each point that is not within your Mandelbrot set as a function of the divergence iteration (ths iteration in which the point exists the disk of radius 2 about the origin). Below is an example of one such coloring. You are free to choose any non-constant coloring function you like.

Using the supplied code, you should be able to explore your your fractal. Below is one such interesting region with the fractal. Notice the self-similiarality and scale-invariance of the geometry.

Extra Credit (5pt)

Implement another famous fractal, the Koch curve (Koch snowflake). You can use the OGL line-drawing functions.
Wikipedia Article