Curves

Parametric curves are the dominant representation in graphics: walk them with t, differentiate for tangents, chain cubics into splines. Bézier's blending form and the de Casteljau construction make them practical.

Core Idea

A curve is a moving point. How you represent it decides what you can do with it — and graphics almost always chooses the parametric form:

Representation Form Trade
Explicit y = f(x) simple, but one y per x — no circles, no vertical lines
Implicit f(x, y) = 0 any shape, great for “is this point on it?” — but hard to walk
Parametric P(t) = (x(t), y(t)) walk it by stepping t, differentiate for tangents, extends to 3D

The construction in the playground above is everything this page is about: four control points, three rounds of interpolation, one moving point — a cubic Bézier.

Bézier: A Polynomial in Blending Form

A cubic Bézier writes a polynomial so that each of its 4 control points appears exactly once, weighted by the Bernstein blending functions (Pascal’s triangle, row 3):

B(t) = (1−t)³·P0 + 3(1−t)²t·P1 + 3(1−t)t²·P2 + t³·P3

The weights always sum to 1 (partition of unity) — without that, the curve would secretly depend on where the origin is. Four properties follow:

  1. Endpoints are interpolated — the curve passes through P0 and P3; P1 and P2 only pull.
  2. Convex hull — the curve never leaves the hull of its control points (the shaded region in the playground). Cheap intersection rejection for free.
  3. Affine invariance — transform the 4 control points and you’ve transformed the whole curve. This is why transformations on curves are practical.
  4. No exact circles — circles aren’t polynomials. (Rational curves fix this — below.)

de Casteljau: The Curve as Repeated Lerp

To evaluate B(t) geometrically: lerp each consecutive pair of control points at t, then lerp the results, until one point remains — that point is on the curve. For a cubic: 3 → 2 → 1. That collapsing ladder is exactly what the playground draws.

Two bonuses fall out of the construction:

Splines: Chaining Cubics

One cubic can only bend so much. Long curves are chains of short cubic segments — splines — and the craft is what happens at the joins:

Class Condition Visual result
C0 endpoints match curves touch — corner allowed
G1 tangent directions match no corner — visually smooth
C1 tangent vectors match (direction + magnitude) smooth + parameter speed continuous
G2 / C2 curvature / second derivative continuous smooth reflections — automotive-grade

For cubic Béziers, C1 at a join means: last handle, join point, and next handle collinear and equidistant (collinear alone gives G1) — exactly what the snap buttons above construct. C3+ is rarely visually distinguishable.

Beyond Bézier

Every mainstream formulation is still a weighted average of control points, C(t) = Σ aᵢ(t)·Pᵢ with weights summing to 1 — they differ in the basis:

What Curves Are For

Use Formulation
Camera / object paths through keyframes Catmull-Rom (centripetal)
Font glyphs quadratic Bézier (TrueType), cubic (PostScript/PDF)
SVG paths, UI motion easing cubic Bézier
CAD / precision surfaces NURBS
Hair & fur rendering splines tessellated on the GPU

Connections

Add a second parameter and a curve becomes a parametric surface P(u,v). The tangent dP/dt is a vector; the second derivative gives curvature and frames, which connect to normals. de Casteljau is nested interpolation — the same lerp that blends colors and animations, applied to itself. And a spline curve is unrelated to Spline the design tool (a visual 3D editor for the web) — same word, different thing.