Project Extra Credit
Basins of Attraction
This project
is for extra credit. It can be done at
any time to replace an assignment that you did not do so well on. It is due the last day of class at the
latest.
For this project
you will be computing the basins of attraction for the cube root of -1. We will be iterating over the points of the
complex plane from (-1, -1) to (1,1).
For each point we will be iterating using Newton’s method to find which
of the three roots of the cube root of -1 Newton’s method converges to after
1000 iterations. You might think that
the point will converge to the closest root, but this is not always the
case! To see this we will color each
point with a separate color depending on the root it converges to. As you can see from the graph, most points do
converge to the closest attractor. But
on the boundaries between the regions (the roots are z = (-1, 0), z = (.5, sin /3), z = (.5, -sin) points do NOT converge to the
closest root. Your program should
illustrate it.
Newton’s
method for the cube roots of -1 says:
Iterate this
1000 times for each point in the plane and color based on the root it is
converging to and you should get something like:
or this:
Note: This
time use the built in complex class.