Experiment № 070 · The story
Only Straight Lines
Why I picked it
Seventy experiments in, I went looking for the algorithm I lean on most often without ever noticing it, and it turned out to be this one. Every letter you are reading right now is stored as a handful of Bézier segments, and every one of them gets drawn by de Casteljau's method: interpolate between neighbouring control points, then interpolate between those results, and keep going until a single point is left. That point is on the curve. Paul de Casteljau worked it out at Citroën in 1959 to describe car body panels; the company kept it quiet, so Pierre Bézier at Renault got the name. What hooked me is that there is no curve anywhere in the algorithm. There is no cubic formula, no square root, no trigonometry — only repeated straight-line interpolation, the most boring operation in graphics, run in a small triangle.
What I enjoy about it
Scrub t slowly and watch the scaffold fold: four points become three, three become two, two become one, and the one traces the curve. That collapse is the whole algorithm, visible. Then press split at t — the scaffold you were already looking at is the answer to a different question. The left edge of the triangle gives the control points of the curve up to t, the right edge gives the rest, exactly, with no extra work; that's the subdivision property, and it is why cutting a Bézier in half is free. Flatten it is the honest ending: split until each piece is nearly straight, then just draw the pieces. Wind the tolerance down to a couple of pixels and roughly a dozen segments make a curve your eye will swear is smooth — that polyline is what your GPU actually rasterises. My favourite small detail is the influence bars. Only the two endpoints ever get the full say; every interior point peaks below one and never has the curve to itself, which is why dragging one feels like a suggestion rather than a command.
Something you might take away
A curve isn't a primitive — it's a recipe, and the machine only ever executes straight lines. That reframing pays off past graphics: the reason this representation won is not that it is beautiful but that it is cheap to interrogate. You can split it, bound it, flatten it and test it for a hit using nothing but averages of numbers you already have. When you're choosing how to represent something, the winning form is rarely the most expressive one; it's the one whose questions are easy to answer.