The chaos game, previously seen on Frank Noschese’s 180 blog and Jonathan Clayton’s blog Infinite Sums.

I had to make this myself (deja vu?). Here’s what I made (processing 2.0):

Check it out live. All these live links will probably work great on your smartphone too. Source code.

## Variations

- Random Triangle Chaos game. Click to set a new random triangle. Source code.
- Square Chaos game. Any key to refresh. Left click to “zoom out”. Right click to “zoom in”. Source code.
- Square Chaos game version 2. Any key to refresh. Left click to “zoom out”. Right click to “zoom in”. Source code.
- Pentagon Chaos game. Any key to refresh. Left click to “zoom out”. Right click to “zoom in”. Source code.
- Hexagon Chaos game. Any key to refresh. Left click to “zoom out”. Right click to “zoom in”. Source code. (Do you notice anything in the negative space?)

## Homework

Can you create any modifications from this source code? Getting started is relatively easy: download processing 2.0.1, paste the source code in and press run.

Note: Thanks to the Math open reference for an applet to calculate the vertex coordinates for the hexagon and pentagon and saving me a little time.

Pingback: Chaos Game v2 » A Recursive Process