Chaos Game

Pn+1 = ( Pn + Vrn ) r

The Chaos Game creates fractals using the following procedure:

  1. Define a polygon with 3 or more vertices
  2. Select a starting point either inside our outside the vertices
  3. Select a random vertex
  4. Mark a point 'r' percent between the point and vertex
  5. Repeat from step 3
It is surprising that this random procedure produces fractals instead of a random cloud of points.

There are several options to be considered when playing the chaos game:

The goal is often to select a value of 'r' that produces shapes that just 'kiss' rather than overlap. The procedure for calculating an optimal value is discussed in depth on wikipedia.

Chaos GameChaos Game with 3 Vertices
Animated Chaos Game with 6 VerticesEffect of selecting different midpoints-6 vertices

Chaos Game with Different Vertex Counts

3 vertices3 Vertices
4 vertices4 Vertices
5 vertices5 Vertices
6 vertices6 Vertices
7 vertices7 Vertices
8 vertices8 Vertices
9 vertices9 Vertices
10 vertices10 Vertices
11 vertices11 Vertices
12 vertices12 Vertices
13 vertices13 Vertices

Examples

Points can be colored according to the number of times they were visited, or by some other technique.
3 vertices