Bezier Curves: The Mathematics of Smooth Animation

simulator beginner ~8 min
Loading simulation...
Cubic Bezier ease-in-out — smooth acceleration and deceleration

A cubic Bezier curve with control points at (0.25, 0.1) and (0.75, 0.9) creates a classic ease-in-out timing function. Motion starts slow, accelerates through the middle, and decelerates at the end — the most natural-feeling animation easing.

Formula

B(t) = (1-t)³P₀ + 3(1-t)²tP₁ + 3(1-t)t²P₂ + t³P₃, t ∈ [0,1]
B'(t) = 3(1-t)²(P₁-P₀) + 6(1-t)t(P₂-P₁) + 3t²(P₃-P₂)

The Curves Behind Everything

Every font you read, every icon on your phone, and every smooth animation on the web is built from Bezier curves. Independently developed by Paul de Casteljau at Citroen in 1959 and Pierre Bezier at Renault in 1962 for designing car bodies, these mathematical curves became the universal language of computer graphics. A cubic Bezier needs only four points to define an infinitely smooth, resolution-independent curve.

Anatomy of a Cubic Bezier

A cubic Bezier curve has two endpoints (P0 and P3) and two control points (P1 and P2). The curve starts at P0 heading toward P1, then bends toward P2 and arrives at P3. The control points act like magnets — they pull the curve without the curve necessarily passing through them. This simulation visualizes the control point influence and lets you reshape the curve in real time.

Animation Easing

In animation, cubic Beziers define timing functions. The CSS cubic-bezier() function maps time (X axis) to progress (Y axis). The default linear timing feels robotic — objects start and stop instantly. Bezier easing adds acceleration and deceleration that mimics real-world physics. The classic ease-in-out — cubic-bezier(0.42, 0, 0.58, 1) — is the most commonly used easing function in UI design.

De Casteljau's Elegant Algorithm

To find a point on the curve at parameter t, De Casteljau's algorithm recursively interpolates between adjacent control points. With four points, three linear interpolations produce three intermediate points; two more interpolations produce two; one final interpolation gives the point on the curve. This recursive subdivision is both numerically stable and visually instructive — the simulation shows the construction lines collapsing to the curve point.

FAQ

What is a Bezier curve?

A Bezier curve is a parametric curve defined by control points. A cubic Bezier has four points: two endpoints and two control points that shape the curve. The curve starts at the first endpoint, is pulled toward the control points, and ends at the last endpoint.

How are Bezier curves used in animation?

In CSS and animation software, cubic Bezier curves define timing functions (easing). The X axis represents time progression and the Y axis represents the animation's completion. Control points shape the acceleration curve — ease-in, ease-out, or custom dynamics.

What is De Casteljau's algorithm?

De Casteljau's algorithm evaluates a Bezier curve at parameter t by recursively interpolating between control points. At each level, adjacent points are linearly interpolated, producing one fewer point until a single point on the curve remains.

Why are Bezier curves used in vector graphics?

Bezier curves are resolution-independent, compact to store (just control points), easy to transform, and produce smooth curves that can approximate any shape. PostScript, SVG, TrueType fonts, and all major design tools use cubic Beziers as their primary curve primitive.

Sources

Embed

<iframe src="https://homo-deus.com/lab/animation-physics/bezier-curves/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub