Four affine maps, a weighted coin, and a million points that land on a fern.
Four rules, a million throws
Michael Barnsley’s fern is defined by four affine maps of the plane and nothing
else. Each takes a point and moves it:
(x, y) → (a·x + b·y + e, c·x + d·y + f)
| Map | a | b | c | d | e | f | p |
|---|
| Stem | 0.00 | 0.00 | 0.00 | 0.16 | 0 | 0.00 | 0.01 |
| Main frond | 0.85 | 0.04 | −0.04 | 0.85 | 0 | 1.60 | 0.85 |
| Left frond | 0.20 | −0.26 | 0.23 | 0.22 | 0 | 1.60 | 0.07 |
| Right frond | −0.15 | 0.28 | 0.26 | 0.24 | 0 | 0.44 | 0.07 |
Start anywhere, pick a map at random with those probabilities, apply it, plot where
you land, repeat. That procedure is the chaos game, and what it converges on is
the set that the four maps together leave unchanged — the attractor. The fern is not
drawn; it is the fixed point of the four rules.
A hundred points. Read on its own this is noise, and the first few points are not
even on the fern — the walk has to fall onto the attractor before it can stay there.
It does so quickly, because every one of the four maps is a contraction.
Why it converges
Each map shrinks distances. The main frond scales by about 0.85, the side fronds by
about a third, the stem flattens everything onto a line. Two points started
anywhere at all are pulled together by every step, so the walk forgets where it
began: within a dozen throws it is on the attractor to within a pixel, and it never
leaves.
That is also why the picture does not shift between the stages below. Each stage is
the same random walk, stopped earlier. Nothing moves; density accumulates.
Two thousand points, and the shape is settled. The stem, the spine, the sweep of the
frond — all of it decided by four rows of six numbers.
The probabilities are areas, not importance
The weights are not aesthetic choices. They are proportional to how much of the
attractor each map is responsible for covering, which is roughly the determinant of
its linear part:
| Map | Determinant | Probability |
|---|
| Stem | 0.00 | 0.01 |
| Main frond | 0.7241 | 0.85 |
| Left frond | 0.0642 | 0.07 |
| Right frond | −0.1088 | 0.07 |
Weighted this way, points arrive at an even density across the whole shape. Weight
them evenly instead and the fern still appears — the attractor does not depend on
the probabilities at all — but the stem, which needs one throw in a hundred to be
drawn at all, would be rendered a hundred times too heavily and the tips would be
starved.
The stem’s determinant is exactly zero: a, b and c are all zero, so that map
collapses the whole plane onto a vertical segment. It has no area to cover, and one
per cent is simply how often the fern needs a stem.
Thirty thousand. The leaflets separate, and each one is a copy of the entire fern —
the main frond map applied once more, at 0.85 scale and four degrees of rotation.
Two hundred thousand. From here on, extra points are tone rather than shape.
Where it stops
A million throws. The limit is arbitrary: the attractor is infinite and the walk
would keep landing on it forever. What a million buys is the tips of the leaflets,
which are the parts reached only through long chains of the side maps and therefore
the last to fill in.
Points are drawn as unantialiased PointSize squares with no blending, so a pixel
struck twice looks exactly like a pixel struck once. Tone comes from coverage
rather than from accumulation — which is why raising the iteration count brightens
the sparse regions and does nothing at all to the dense ones.
Seven renderings
The variants differ along three deliberate axes. Four of them converge to
structurally different attractors; the rest change how the canonical attractor
is framed, stopped, and inked rather than recolouring the same picture.
| Rendering | Structure | Iterations | Point size | Ink |
|---|
| Emerald | canonical — slight bilateral curve | 1,000,000 | 1.5px | #2BD57D on #04120A |
| Golden | swept — trunk arcs strongly rightward | 1,000,000 | 1.5px | #FFD700 on #1A1200 |
| Rose | leaning — the whole plant bends left | 1,000,000 | 1.5px | #F2A0B5 on #160A10 |
| Violet | wide-leaflet — broader frond fans | 1,500,000 | 1.0px | #CC88FF on #0A0010 |
| Crown | canonical — the whole upper canopy | 1,500,000 | 1.0px | #5ADBC8 on #03151A |
| Ember | canonical — landscape crop of the widest leaflets | 120,000 | 2.4px | #FF8C42 on #0F0A05 |
| Paper | canonical, ink on a light ground | 1,000,000 | 1.4px | #1D2B38 on #F4EFE4 |
The golden variant doubles the main-frond rotation coefficients (b, c: 0.04 →
0.08), bending the trunk into a visible arc. The rose variant adds a horizontal
drift to the frond maps (e: 0 → −0.10), sweeping the entire plant left. The
violet variant scales the side-frond linear parts up ~50%, fanning the leaflets
further from the axis. All four remain recognisably Barnsley ferns — the same
four-map IFS structure, different geometry.
Crown crops the canonical attractor to its upper canopy on a square canvas —
the whole canopy, frond tip included, since the tip sits far right of the
trunk. Ember crops the landscape canvas to the heart of the fern, where the
leaflets are widest, and stops the walk after 120,000 throws and draws larger
points, so the grain of the chaos game stays visible as individual marks.
Paper inverts the ground, printing slate ink on warm paper. Every variant
carries its own seed, so no two share the same walk.
Crops end in a clean line rather than a band of stray marks: a preset whose
window cuts into the attractor skips the points outside it, so nothing leaks
into the canvas edge where the crop stops.
The museum treatment
One plate is not a rendering but a presentation: the emerald fern hung as a
finished piece — on a gallery wall, behind a mat, in a dark frame, with an
engraved plaque beneath it. The wall, the mat, the frame, and the plaque are
drawn by a presentation layer that wraps the lead preset without touching it;
the fern inside is byte for byte the emerald render. The plaque’s engraving is
cut in the piece’s own mark — unantialiased squares from a five-by-seven pixel
font — so it borrows no font from whichever machine renders it.
It is one plate, not a family: the museum treatment frames the lead preset
only, because a framed copy of every variant would be a wall of duplicates
rather than a presentation.
Determinism
Each preset’s walk is seeded from its own Seed, so the same points land in the
same places on every run. The generator is System.Random, which the project’s
determinism policy flags as not guaranteed stable across .NET versions; the piece is
reproducible on a given runtime but is not one of the pieces that can be pinned by
hash across all of them.