Gingerbread Man: absolute value, cookie silhouette — Classical Chaos
Devaney’s Gingerbread Man is a tiny 2D map that somehow reads like a cookie: head, arms, that awkward stance. Robert L. Devaney popularized it (Physica D, 1984). Piecewise linear: almost a linear recurrence, except one absolute value that folds the plane. Classical Chaos starts at (−0.1, 0). The classic map is fixed; there are no a/b knobs to retune the formula.
The cloud below grows from that seed. Hue steps in chunks along the sequence (hsl-chunk coloring), so the pile stays varied instead of going flat.
The fold
Two lines:
const nextX = 1 - y + Math.abs(x)
const nextY = x
x = nextX
y = nextY
Without the absolute value this would feel almost linear. The |x| is the nonlinearity: it folds the plane so points that went one way bounce into another branch. That fold is what lets a bounded, filled region pile up into the silhouette.
The orbit sits offset from the origin, so the stage recenters the camera with a scale-and-offset framing. The cookie lands in the middle of the view instead of drifting off to one side.
What shows up
Inside that filled region the dynamics get interesting. Literature notes hexagonal patches of periodic orbits (a period-6 interior hexagon and friends). Cookie shape and “chaos everywhere” are not the same sentence: some neighborhoods settle into cycles; the silhouette as a whole still feels alive when the cloud grows.
Full canvas
On the full Gingerbread Man stage sit with the longer view of the same fixed map from (−0.1, 0).
![]()