Chaos Game
Pick some points and jump part of the way to a random one, over and over. Fractals appear. From the blog post Strange Attractors.
How it works
Start anywhere. Pick one of the points at random and jump a fraction of the way towards it, the jump ratio. Repeat millions of times and mark where you land. With three points and a ratio of one half you get the Sierpinski triangle.
Rules about which point can come next, weights and per-point turns or matrices make many more shapes. The details are in the docs.
Run
0 jumps
Jumps
How far towards the chosen point each jump goes.
Points
Click the plot to add a point. Drag a point to move it.
| # | x | y | Remove |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 |
Display
Higher shows faint regions more.
Watch the first jumps one at a time.
Challenges
Pick a pattern and try to make it. It shows faintly behind your game, and the match ignores position and size. The first ten are from the original blog post.
References
- Barnsley, M. F. (1988). Fractals Everywhere. Academic Press. Named the chaos game and showed it draws the attractor of any contracting set of affine maps, the fern included.
- Numberphile (2017). Chaos Game. YouTube. The video behind the original blog post, with the restricted-choice squares.
- Draves, S. & Reckase, E. (2008). The Fractal Flame Algorithm. flam3.com. Log-density shading with a gamma, which keeps faint and dense regions both visible.