Koch Snowflake Generator
One rule, drawn slowly so you can watch the shape arrive: take every edge, cut it into thirds, and pop an equilateral bump out of the middle. Repeat. Point the bumps outward and order appears — the perfect Koch snowflake. Point them inward for its hollow twin. Or let each bump flip a coin and the very same rule grows a wild, random coastline. The outline never stops getting longer, yet it always encloses a finite area.
Why it's beautiful — and a little impossible
Every round multiplies the number of edges by four while shrinking each to a third of its length, so the perimeter grows by 4/3 each time — 3, 4, 5.33, 7.1, 9.5, … off to infinity. The added bumps get tiny so fast, though, that the enclosed area only ever creeps up to 8/5 of the starting triangle. An infinitely long boundary around a finite area: that's the paradox the snowflake makes visible.
It is self-similar — zoom into any edge and you'd find the whole construction again — and its fractal dimension is log 4 / log 3 ≈ 1.2619: more than a line, less than a filled shape. The random mode keeps the exact same dimension and perimeter growth, yet no two runs look alike — order and randomness wearing the same clothes.
The maths lives in logic.py (the point construction and the
perimeter / area / dimension you see above); the browser just strokes the
line list, one segment at a time, at the pace you choose.