Barnsley Fern
A photorealistic fern grown from four affine transformations applied randomly in sequence.
The Four Rules
A Barnsley fern is a fractal defined by four affine transformations, each applied with a fixed probability:
| Transform | Probability | Effect |
|---|---|---|
| f₁ | 1% | Stem |
| f₂ | 85% | Frond (main body) |
| f₃ | 7% | Left leaflet |
| f₄ | 7% | Right leaflet |
The coordinate axes. Every point in the fern will land in the region x ∈ [−2.2, 2.7], y ∈ [0, 9.9].
The Chaos Game
Start at the origin. Randomly pick one of the four transforms according to their probabilities. Apply it. Plot the point. Repeat millions of times.
After ten thousand iterations the fern outline is already visible — the stem, the main frond, and the two smaller side fronds. The structure emerges from randomness.
Convergence
The fern is an attractor of the iterated function system. No matter where you start, the orbit will converge to the same shape. The probabilities only affect how densely each part is filled, not the shape itself.
After one million iterations the fern is dense and detailed. Individual leaflets are distinct; the recursive self-similarity is clear: each frond is a scaled copy of the whole.