next up previous
Next: Draw two overlapping targets Up: Assignment 5: Moiré patterns Previous: Iterate

Draw a very fine target

1.
An interesting thing starts to happen as skip gets small. Run your program with smallest = 2, biggest = 400, and skip = 2. Did you get what you expected? If you did, you know too much and you should go outside and play. For the rest of us, the unexpected coolness on the screen is called a Moiré pattern, and it is the result of a type of roundoff error called aliasing. For more information on Moiré patterns, see the following web pages:

	http://www.thepalace.com/jbum/pixmagic/galmoire.html
	http://www.exploratorium.edu/xref/exhibits/moire_patterns.html

2.
You can make your target even cooler by changing the color using setColor.



Allen B. Downey
3/3/1998