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:
- Endpoints are interpolated — the curve passes through P0 and P3; P1 and P2 only pull.
- Convex hull — the curve never leaves the hull of its control points (the shaded region in the playground). Cheap intersection rejection for free.
- Affine invariance — transform the 4 control points and you’ve transformed the whole curve. This is why transformations on curves are practical.
- 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:
- The last surviving line is the tangent — the derivative
dB/dtof a degree-n Bézier is a degree-(n−1) Bézier, and de Casteljau hands you its direction for free. - The intermediate points are the control points of the two halves of the curve split at t — repeat the split and pieces converge to line segments, which is how renderers turn Béziers into drawable strokes.
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:
- B-splines — different basis, any degree; cubic B-splines are C2 at every join automatically, but interpolate no control point (repeat endpoints to pin them). Any B-spline converts to piecewise Bézier.
- Rational curves — give each control point a weight
wᵢand normalize. The payoff: rational quadratics represent circles and conics exactly (vary the middle weight: parabola → hyperbola → ellipse). - NURBS — rational B-splines with freely spaced knots: detail where you need it. The CAD/CAM industry standard; generalizes to surfaces by tensor product.
- Catmull-Rom — the interpolating one: passes through its control points, so it’s the tool for keyframe paths. Use centripetal parametrization — it provably avoids self-intersection loops that the uniform variant produces.
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.