All families

The chaos game

The image is drawn point by point, never traced in one go.

The rule

The chaos game fits in one sentence: start from a point, pick a vertex at random, move a fraction of the way towards it, place a point, and start again. Here is the rule:

p' = p + r·(v − p)

Here p is the current point, v the chosen vertex and r the fraction of the way. With a triangle and r = ½, the point moves halfway. The first jumps look messy, but after a few thousand points the holes of the Sierpiński triangle appear: each jump sends the point into one of the three small triangles in the corners, never into the empty middle.

The Barnsley fern changes one detail. Instead of a vertex, we pick one transformation out of four, each with its own weight, and apply it to the point:

(x, y) → (a·x + b·y + e, c·x + d·y + f)

The four sets of numbers a, b, c, d, e and f are the fern's. The stem is picked once in a hundred, the large leaflets 85 times in a hundred, and each of the two pairs of small leaflets 7 times in a hundred.

Your turn

Choose a shape, then place one point with the button: the arrow shows the chosen vertex, and the marked point is the new one. After a few clicks the rule is clear, but the image is not there yet.

Place ten thousand points at once, or start playback to watch them arrive little by little. Move the ratio: the triangle fills in or breaks apart. The pentagon starts at 0.62, the ratio of the Pentaflake algorithm, taken from the golden ratio. The fern has no ratio: it picks a transformation, not a vertex.

0.5

Points placed 0

The drawing above is a teaching sketch, not the artwork: it shows the rule, it does not replay the colours, the size of the dots or the grain of the print.

What changes from one algorithm to the next

All five play the same game: a point that jumps from one transformation to the next. What changes is who chooses those transformations: the rule is written in advance, or it is drawn for each artwork.

Barnsley Fern
The fern from the toy. Four transformations, the stem, the large leaflets and two pairs of small leaflets, played according to their weight. The scatter of points changes with the seed, but the fern stays a fern.
Sierpiński Triangle (Chaos)
The triangle from the toy: three vertices picked with equal chances, and the point moves halfway. The holes appear by accumulation. From one artwork to the next, only the scatter changes.
Pentaflake (Sierpiński Pentagon)
The five-vertex cousin. A regular pentagon, and the point covers 1/φ ≈ 0.62 of the way to the chosen vertex, where φ is the golden ratio: each copy is therefore shrunk by 1/(1+φ). Five small pentagons appear in the corners.
Bounded Random IFS
Here the rule itself is drawn at random, within bounds: a number of transformations, and bounded coefficients so that the figure stays in the frame. Each artwork therefore invents its own attractor, and some work better than others: that is why I sort by hand before publishing.
Fractal Flame
A fractal flame, after Scott Draves (2003). The transformations are no longer only affine but nonlinear, and the colour comes from a density map: the more a spot is visited, the brighter it glows. Millions of points pile up, and the shape is drawn for each artwork.

What chance decides

For each artwork, the program draws these settings at random, between bounds set in advance.

  • Number of points Barnsley Fern from 25,000 to 60,000
  • Number of transformations Bounded Random IFS from 3 to 5
  • Contraction factor Bounded Random IFS from 0.35 to 0.6

The algorithms in this family

  • Barnsley Fern
  • Sierpiński Triangle (Chaos)
  • Pentaflake (Sierpiński Pentagon)
  • Bounded Random IFS
  • Fractal Flame

Artworks from this family

All families