Quiz 8: Fractal Pterodactyl

In class, we discussed fractals as one interesting example of implicitly-defined geometry. In this quiz, you will write some very, very simple code to implement a beautiful variation on the classic Mandelbrot set, called the Julia set:


The basic idea is almost identical to the Mandelbrot set: iterate the complex recurrence

z = z^2 + c

until the norm of the point $z$ either diverges, or converges to some stable point. (There are also points that will just wander around the plane periorically forever---for this reason, one typically caps the number of iterations at some maximum value.)

Your task is to implement this recurrence in the starter code here---almost everything has been setup for you already:

Starter code

Note that you may need to hit the "RUN" button in order for the code to run.

You will find two sections of the code labeled PART I and PART II, which describe exactly what to do. PART III of the assignment is to play with the parameters (e.g., ka, kb) and colors in the code, and generate the most beautiful Julia set you possibly can. If you get nice results, post them on Piazza! :-)


To hand this quiz in you should:

  • post a picture of your result on Piazza, in full glorious color, and
  • print out the two chunks of your solution code (for PART I and PART II) and bring them to the beginning of the next lecture.

*Sorry, there are actually no pterodactyls in this quiz.