Bézier Curves and the de Casteljau Algorithm

Drag control points to reshape a Bézier curve, then move t to see the de Casteljau construction and Bernstein weights.

  • Bézier curve
  • Control polygon
  • Intermediate levels
  • B(t)

Drag a control point, or press Tab to focus one and use the arrow keys to move it.

Coordinates run from 0 to 1 across the grid. x increases to the right and y increases downwards.

Curve degree

Parameter and playback

Current point on the curve

Degree 3
B(t) (0.500, 0.325)
Selected control point P0 (0.150, 0.700)

Bernstein weights

Bézier curve formulas

A degree-n Bézier curve uses n + 1 control points with the parameter t ranging from 0 to 1.

Quadratic
B(t) = (1 − t)2P0 + 2(1 − t)tP1 + t2P2
Cubic
B(t) = (1 − t)3P0 + 3(1 − t)2tP1 + 3(1 − t)t2P2 + t3P3
General form
B(t)= ∑i=0n (ni) (1−t)n−i ti Pi

What is a Bézier curve?

A Bézier curve defines a path from a set of control points. Pierre Bézier used related methods for car body design at Renault. Paul de Casteljau independently developed his interpolation algorithm at Citroën.

How control points constrain the curve

de Casteljau algorithm

Fix t and take a point at the same fraction along every segment between neighboring control points. Connect the new points and repeat. Each level has one fewer point until only B(t) remains.

At t = 0.5, every round takes midpoints. During playback, t moves at a steady rate while the distance the marker travels depends on the curve.

Where the curves are used

Try the controls