Mini-Homework 4: Fractal Pterodactyl

This mini-homework is due Tuesday, September 22. Submit your solution via Gradescope.

Part A

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:

JuliaSet

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! :-)

Part B

In class, we saw that rotations can be expressed both as Euler angles and quaternions. This demo interpolates rotation values to generate a smooth sequence using both representations. Briefly explain which representation would you want to use for interpolation and why?

Handin

To hand this quiz in you should:

  • post a picture of your result on Piazza, in full glorious color, and
  • write down the two chunks (Part I and II) of your solution code for Part A and your response for Part B and submit it via Gradescope.

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