Book contents
Contents
raw Math

Two points determine a straight segment. Could a third point bend that segment without becoming a point the path has to pass through? A Bézier curve does exactly that: the outer points are endpoints, and the inner controls shape the path without generally lying on it. That is the distinction between specifying control points and asking a curve to interpolate given data points.

The black points below are the endpoints of a cubic. Move the first outlined control, \(\mathbf P_1\): which endpoint moves, and which way does the curve leave \(\mathbf P_0\)? The path changes but both endpoints stay fixed. Moving \(\mathbf P_1\) generally changes every interior curve point, not just its neighbors.

Points, Parameters, and Linear Interpolation

A parametric curve gives every coordinate as a function of one shared parameter. For a planar curve,

\[ \mathbf B(t)=\begin{pmatrix}x(t)\\y(t)\end{pmatrix},\qquad 0\leq t\leq1. \]

The parameter orders points along the curve, but it is not generally distance. Halfway in parameter space need not be halfway along the path. It is not necessarily time either: in a CSS timing curve, elapsed time selects the horizontal coordinate \(x(t)\); solve for \(t\) before reading progress from \(y(t)\). The elementary building block is the affine combination

\[ \operatorname{lerp}(\mathbf P,\mathbf Q;t) =(1-t)\mathbf P+t\mathbf Q =\mathbf P+t(\mathbf Q-\mathbf P). \]

At \(t=0\) it returns \(\mathbf P\); at \(t=1\) it returns \(\mathbf Q\). For \(0<t<1\), both coefficients are nonnegative and sum to one, so the result lies on the segment between the two points. That simple coefficient rule will later explain the convex-hull property of an entire Bézier curve.

de Casteljau's Construction

Start with three controls. At the same parameter \(t\), take a point on each of the two neighboring segments, then interpolate once more between the results:

\[\begin{aligned} \mathbf A(t)&=(1-t)\mathbf P_0+t\mathbf P_1,\\ \mathbf D(t)&=(1-t)\mathbf P_1+t\mathbf P_2,\\ \mathbf Q(t)&=(1-t)\mathbf A(t)+t\mathbf D(t)\\ &=(1-t)^2\mathbf P_0+2t(1-t)\mathbf P_1+t^2\mathbf P_2. \end{aligned}\]

At \(t=0\) each interpolation keeps its first point; at \(t=1\) each keeps its last. The result runs from \(\mathbf P_0\) to \(\mathbf P_2\). The two intermediate points are on the triangle's edges, so the final segment joining them is inside the triangle. With four controls the same construction takes three rounds. In the diagram, can any intermediate segment leave the original shaded region?

Paul de Casteljau developed this recursive construction at Citroën in 1959. Pierre Bézier's independent work at Renault later made the polynomial curve representation widely known in geometric design. Every evaluation in either formulation is built from repeated linear interpolation.

Given control points \(\mathbf P_0,\ldots,\mathbf P_n\), interpolate every adjacent pair using the same \(t\). Repeat on the shorter list until one point remains. Define

\[ \mathbf P_i^{(0)}=\mathbf P_i,\qquad \mathbf P_i^{(r)}(t)=(1-t)\mathbf P_i^{(r-1)}(t)+t\mathbf P_{i+1}^{(r-1)}(t). \]

After \(n\) rounds, \(\mathbf B(t)=\mathbf P_0^{(n)}(t)\). Change the degree, move the slider, or drag the control points below. Colored segments show the successive interpolation levels; the larger red point is the final result.

0.35

This recursive construction is not merely a drawing aid. It is numerically stable, works in any dimension, and produces all control points needed to split the curve. Each new level lies in the convex hull of the preceding level: it consists of convex combinations of pairs in that hull. Since the hulls are nested, the final point cannot leave the original hull. The implementation is short:

function evaluate(points, t) {
  let level = points.map(point => ({ ...point }));
  while (level.length > 1) {
    level = level.slice(0, -1).map((point, i) => ({
      x: point.x + (level[i + 1].x - point.x) * t,
      y: point.y + (level[i + 1].y - point.y) * t
    }));
  }
  return level[0];
}

The Bernstein Form

In a full expansion of the interpolation triangle, choosing a right neighbor contributes a factor \(t\); choosing a left neighbor contributes \(1-t\). A path that reaches \(\mathbf P_i\) has made exactly \(i\) right choices in \(n\) rounds. There are \(\binom ni\) such paths, counted by Pascal's triangle: the quadratic weights have coefficients \(1,2,1\), and the cubic weights \(1,3,3,1\). Grouping the terms gives

\[ \mathbf B(t)=\sum_{i=0}^{n} b_{i,n}(t)\mathbf P_i, \qquad b_{i,n}(t)=\binom ni(1-t)^{n-i}t^i. \]

The functions \(b_{i,n}\) are the Bernstein basis polynomials. For every \(t\in[0,1]\), they are nonnegative and form a partition of unity:

\[ \sum_{i=0}^{n}b_{i,n}(t)=((1-t)+t)^n=1. \]

Therefore \(\mathbf B(t)\) is always a convex combination of the control points. The graph shows the four cubic basis weights. At any vertical slice they add to one; the curve point is the control-point average using exactly those weights.

0.35

Linear, Quadratic, and Cubic Curves

The first three degrees are worth knowing explicitly:

\[ \begin{aligned} \mathbf L(t)&=(1-t)\mathbf P_0+t\mathbf P_1,\\ \mathbf Q(t)&=(1-t)^2\mathbf P_0+2(1-t)t\mathbf P_1+t^2\mathbf P_2,\\ \mathbf C(t)&=(1-t)^3\mathbf P_0+3(1-t)^2t\mathbf P_1+3(1-t)t^2\mathbf P_2+t^3\mathbf P_3. \end{aligned} \]

Quadratics have one internal control point and cannot inflect. Cubics have two internal controls and can form an S-shape, cusp, or loop. In SVG, M 10 70 C 20 10 80 10 90 70 starts at \((10,70)\), uses \((20,10)\) and \((80,10)\) as controls, and ends at \((90,70)\). Neither control is a destination. Graphics systems usually join many low-degree segments instead of using one high-degree curve: local edits remain local, evaluation stays cheap, and numerical behavior is easier to control.

Geometric Properties

The Bernstein representation gives several useful facts immediately:

Affine invariance is especially important in software. Evaluation may happen in object coordinates and the result can then be transformed, or the controls may be transformed first; both routes agree. Perspective projection is not affine, which is one reason rational Bézier curves and homogeneous coordinates matter in 3D pipelines.

To see why, write an affine map as \(A(\mathbf x)=M\mathbf x+\mathbf c\). Because the Bernstein weights sum to one,

\[ \begin{aligned} A(\mathbf B(t)) &=M\sum_{i=0}^{n}b_{i,n}(t)\mathbf P_i+\mathbf c\\ &=\sum_{i=0}^{n}b_{i,n}(t)\bigl(M\mathbf P_i+\mathbf c\bigr) =\sum_{i=0}^{n}b_{i,n}(t)A(\mathbf P_i). \end{aligned} \]

Thus an affine transformation can be applied to the few control points rather than to every evaluated point on the curve. Translation, rotation, reflection, shear, and nonuniform scaling all satisfy this identity.

Derivatives, Tangents, and Normals

Differentiate each basis weight. Differentiating the power of \(t\) contributes \(n b_{i-1,n-1}(t)\); differentiating the power of \(1-t\) contributes \(-n b_{i,n-1}(t)\), with indices outside the basis taken as zero. Grouping by the surviving degree-\(n-1\) weights pairs adjacent controls:

\[ \mathbf B'(t)=n\sum_{i=0}^{n-1}b_{i,n-1}(t)(\mathbf P_{i+1}-\mathbf P_i). \]

Its control points are \(n(\mathbf P_{i+1}-\mathbf P_i)\). In particular, \(\mathbf B'(0)=n(\mathbf P_1-\mathbf P_0)\) and \(\mathbf B'(1)=n(\mathbf P_n-\mathbf P_{n-1})\), because only the outer basis weight survives at each end. If the endpoint and its neighboring control coincide, the first derivative vanishes there, so that edge cannot specify a unit tangent. When \(\mathbf B'(t)\neq\mathbf0\), the planar unit tangent and one consistently oriented unit normal are

\[ \mathbf T(t)=\frac{\mathbf B'(t)}{\|\mathbf B'(t)\|}, \qquad \mathbf N(t)=\begin{pmatrix}-T_y(t)\\T_x(t)\end{pmatrix}. \]

0.40

Joining Segments Smoothly

Suppose one segment ends where the next begins. Several notions of continuity must be distinguished:

For adjacent cubics \(\mathbf P_0,\ldots,\mathbf P_3\) and \(\mathbf Q_0,\ldots,\mathbf Q_3\), \(C^0\) requires \(\mathbf P_3=\mathbf Q_0\), while \(C^1\) additionally requires

\[ \mathbf P_3-\mathbf P_2=\mathbf Q_1-\mathbf Q_0. \]

For \(G^1\) the two directed edges must be nonzero positive multiples, not just collinear. For \(C^2\), their second differences must also agree: \(\mathbf P_3-2\mathbf P_2+\mathbf P_1=\mathbf Q_2-2\mathbf Q_1+\mathbf Q_0\). The conditions assume both segments have local parameter intervals of length one. A CAD contour can have no visible kink at a \(G^1\) join yet still exhibit a jump in parameter speed. Even \(C^1\) continuity does not ensure constant speed along either segment. Switch from \(G^1\) to \(C^1\): what changes in the highlighted tangent handles?

Subdivision

The edges of the de Casteljau triangle already contain two new control polygons. At a split parameter \(s\), the left edge controls the interval \([0,s]\), and the right edge in reverse order controls \([s,1]\). Together the two curves reproduce the original exactly.

For a cubic \(\mathbf P_0,\mathbf P_1,\mathbf P_2,\mathbf P_3\), write one complete de Casteljau triangle as

\[ \begin{aligned} \mathbf A&=(1-s)\mathbf P_0+s\mathbf P_1,& \mathbf B&=(1-s)\mathbf P_1+s\mathbf P_2,& \mathbf C&=(1-s)\mathbf P_2+s\mathbf P_3,\\ \mathbf D&=(1-s)\mathbf A+s\mathbf B,& \mathbf E&=(1-s)\mathbf B+s\mathbf C,& \mathbf F&=(1-s)\mathbf D+s\mathbf E. \end{aligned} \]

The split point is \(\mathbf F=\mathbf B(s)\). The left child has controls \(\mathbf P_0,\mathbf A,\mathbf D,\mathbf F\), and the right child has controls \(\mathbf F,\mathbf E,\mathbf C,\mathbf P_3\). At \(s=1/2\), every operation is an average; no separate midpoint formula is needed.

To see why the children reproduce the curve, evaluate the left child at \(u\). Expand the interpolation as before: choosing its \(j\)-th control means taking \(j\) right branches in \(n\) rounds. That control is the first point after \(j\) rounds at \(s\). So each right branch, of weight \(u\), advances an original control index only if it also takes the subsequent right branch of weight \(s\). The combined advance has weight \(su\); staying put has weight \((1-u)+u(1-s)=1-su\). The left child therefore equals \(\mathbf B(su)\). Reversing the controls proves the right child equals \(\mathbf B(s+(1-s)u)\). In the plot, the thick gray original stays fixed as the split moves.

The controls are read directly from the two boundary chains of the triangle, not fitted to sampled points. Moreover, \(\mathbf D,\mathbf F,\mathbf E\) are collinear because \(\mathbf F=(1-s)\mathbf D+s\mathbf E\). The last edge of the left polygon and the first edge of the right polygon therefore share the original tangent direction at the split. With local child parameters \(u\), their endpoint derivatives are \(s\mathbf B'(s)\) and \((1-s)\mathbf B'(s)\), respectively.

0.50

Subdivision is the workhorse behind adaptive rendering and intersections. It avoids deriving a new equation for each operation: repeatedly split, reject pieces that cannot matter, and continue only where more resolution is needed. A subcurve over an arbitrary interval \([a,b]\) follows from splitting at \(b\), retaining the left curve, then splitting that curve at \(a/b\) and retaining the right part.

Repeated subdivision does not change the curve. It replaces its control polygon by smaller child polygons whose maximum distance from the curve tends to zero. Connecting the accepted child endpoints therefore yields a convergent polyline approximation; a flatness bound turns this into an adaptive stopping rule.

References