Linear Algebra › Section H · The geometry of vector spaces › Topic H.6
Curves and surfaces
The letters of most digital fonts and many car-body panels are drawn with Bézier curves, built from a few control points by convex combinations. This topic shows how those curves are defined, why they behave so predictably, how pieces join smoothly, and how the same idea makes surfaces.
Curves from control points
Designers need smooth curves shaped by dragging a few handles, and Bézier curves provide them. They were developed independently in car design around 1960, by Paul de Casteljau at Citroën and Pierre Bézier at Renault, and today they define the outlines of fonts, vector illustrations and animation paths. A Bézier curve is fixed by a short list of control points. It starts at the first and ends at the last, while the middle points pull the curve towards themselves without, in general, lying on it. Every point of the curve is a convex combination of the control points, which is why the ideas of this section of the course apply.
Quadratic Bézier curves
Three control points \(\mathbf{p}_0, \mathbf{p}_1, \mathbf{p}_2\) define the quadratic Bézier curve
At \(t = 0\) it is at \(\mathbf{p}_0\), and at \(t = 1\) at \(\mathbf{p}_2\). The three weights are non-negative and add to \(((1 - t) + t)^2 = 1\), so each \(\mathbf{w}(t)\) is a convex combination. Differentiating gives \(\mathbf{w}'(0) = 2(\mathbf{p}_1 - \mathbf{p}_0)\) and \(\mathbf{w}'(1) = 2(\mathbf{p}_2 - \mathbf{p}_1)\): the curve leaves \(\mathbf{p}_0\) heading towards \(\mathbf{p}_1\) and arrives at \(\mathbf{p}_2\) coming from the direction of \(\mathbf{p}_1\).
Cubic Bézier curves
Drawing programs mostly use four control points \(\mathbf{p}_0, \dots, \mathbf{p}_3\) and the cubic curve
for \(0 \le t \le 1\). The weights are the cubic Bernstein polynomials, the terms in the expansion of \(((1 - t) + t)^3\), so again they are non-negative and add to 1. The end tangents are \(\mathbf{x}'(0) = 3(\mathbf{p}_1 - \mathbf{p}_0)\) and \(\mathbf{x}'(1) = 3(\mathbf{p}_3 - \mathbf{p}_2)\). Moving \(\mathbf{p}_1\) or \(\mathbf{p}_2\) bends the curve without moving its endpoints, which is exactly the handle behaviour a designer wants. The convex hull property follows: the whole curve lies in the convex hull of its four control points.
Worked example: points on a cubic
Take \(\mathbf{p}_0 = (0, 0)\), \(\mathbf{p}_1 = (1, 3)\), \(\mathbf{p}_2 = (4, 3)\), \(\mathbf{p}_3 = (5, 0)\). 1. At \(t = \tfrac{1}{2}\) every factor \(t\) and \(1 - t\) is \(\tfrac{1}{2}\), so the weights are \(\tfrac{1}{8}, \tfrac{3}{8}, \tfrac{3}{8}, \tfrac{1}{8}\). 2. The \(\mathbf{p}_0\) term is zero, so
which is \(\tfrac{1}{8}(20, 18) = (2.5, 2.25)\). 3. At \(t = \tfrac{1}{3}\) the weights are \(\tfrac{8}{27}, \tfrac{12}{27}, \tfrac{6}{27}, \tfrac{1}{27}\), giving
4. The starting tangent is \(3(\mathbf{p}_1 - \mathbf{p}_0) = (3, 9)\). 5. Both points lie inside the quadrilateral of control points, as the convex hull property requires.
The matrix form
Expanding the Bernstein weights in powers of \(t\) gives a compact matrix description:
Here \(G\) is the geometry matrix whose columns are \(\mathbf{p}_0, \dots, \mathbf{p}_3\), and \(\mathbf{u}(t) = (1, t, t^2, t^3)\). Row 1 of \(M_B\) times \(\mathbf{u}(t)\) is \(1 - 3t + 3t^2 - t^3 = (1 - t)^3\), the weight on \(\mathbf{p}_0\), and the other rows give the other weights. So \(M_B\) converts the monomial basis of cubic polynomials into the Bernstein basis.
Joining curves smoothly
Long shapes are drawn as chains of cubics. Let \(\mathbf{x}(t)\) have control points \(\mathbf{p}_0, \dots, \mathbf{p}_3\) and the next piece \(\mathbf{y}(t)\) have \(\mathbf{p}_3, \dots, \mathbf{p}_6\), sharing \(\mathbf{p}_3\); that shared point gives \(G^0\) continuity, no gap. Since \(\mathbf{x}'(1) = 3(\mathbf{p}_3 - \mathbf{p}_2)\) and \(\mathbf{y}'(0) = 3(\mathbf{p}_4 - \mathbf{p}_3)\), the pieces have \(C^1\) continuity, equal tangent vectors, exactly when \(\mathbf{p}_3\) is the midpoint of \(\mathbf{p}_2\) and \(\mathbf{p}_4\). The weaker \(G^1\) continuity asks only that the tangents point the same way: \(\mathbf{p}_4 - \mathbf{p}_3 = k(\mathbf{p}_3 - \mathbf{p}_2)\) for some \(k > 0\), so the three points are collinear with \(\mathbf{p}_3\) between. \(C^2\) continuity also matches second derivatives, as cubic B-splines always do.
Worked example: a smooth join
Extend the curve with control points \((0, 0), (1, 3), (4, 3), (5, 0)\) by a second cubic starting at \(\mathbf{p}_3 = (5, 0)\). 1. For \(C^1\) continuity, \(\mathbf{p}_3\) must be the midpoint of \(\mathbf{p}_2\) and \(\mathbf{p}_4\), so
2. Check: \(\mathbf{x}'(1) = 3(\mathbf{p}_3 - \mathbf{p}_2) = 3(1, -3)\) and \(\mathbf{y}'(0) = 3(\mathbf{p}_4 - \mathbf{p}_3) = 3(1, -3)\), both \((3, -9)\). Equal. 3. For \(G^1\) only, \(\mathbf{p}_4 = (5, 0) + k(1, -3)\) with any \(k > 0\); with \(k = \tfrac{1}{2}\), \(\mathbf{p}_4 = (5.5, -1.5)\), and the tangent \(\mathbf{y}'(0) = (1.5, -4.5)\) points the same way at half the speed. 4. Choosing \(\mathbf{p}_4 = (6, 0)\) would leave a visible corner at \(\mathbf{p}_3\).
Subdivision by repeated midpoints
De Casteljau's method evaluates and splits a curve using only averages. For \(t = \tfrac{1}{2}\), take midpoints of consecutive control points, then midpoints of those, then once more. With the example: the first midpoints are \((0.5, 1.5)\), \((2.5, 3)\), \((4.5, 1.5)\); the next are \((1.5, 2.25)\), \((3.5, 2.25)\); the last is \((2.5, 2.25)\), which is \(\mathbf{x}(\tfrac{1}{2})\), as computed before. Better still, the left half of the curve is the cubic with control points \((0, 0)\), \((0.5, 1.5)\), \((1.5, 2.25)\), \((2.5, 2.25)\), and the right half has \((2.5, 2.25)\), \((3.5, 2.25)\), \((4.5, 1.5)\), \((5, 0)\). Repeating the split makes the control polygons hug the curve, so software can draw it as short line segments.
Bézier surfaces
A bicubic Bézier patch uses a 4 × 4 grid of 16 control points \(\mathbf{p}_{ij}\) and two parameters:
where \(B_0, \dots, B_3\) are the cubic Bernstein weights. Fixing \(u\) gives a cubic Bézier curve in \(v\), and fixing \(v\) gives one in \(u\). The products \(B_i(u)B_j(v)\) are non-negative and add to \(1 \times 1 = 1\), so each point of the patch is a convex combination of the 16 control points, and the patch lies in their convex hull. The four corner control points lie on the patch; the four boundary edges are the cubic curves defined by the outer rows and columns of the grid.
Common mistakes to avoid
First, expecting the curve to pass through \(\mathbf{p}_1\) and \(\mathbf{p}_2\); it only passes through the endpoints. Second, dropping the factor 3 in the end tangents of a cubic, or using 3 for a quadratic, whose factor is 2. Third, mixing up \(C^1\) and \(G^1\): collinear control points with \(\mathbf{p}_3\) between give \(G^1\), but \(C^1\) needs \(\mathbf{p}_3\) exactly at the midpoint. Fourth, writing the middle weight as \(t(1 - t)^2\) without the binomial coefficient 3, so the weights no longer add to 1. Fifth, using values of \(t\) outside \([0, 1]\), where some weights turn negative and the convex hull property fails.
Key takeaways
A quadratic Bézier curve is (1 − t)²p₀ + 2t(1 − t)p₁ + t²p₂ and a cubic is (1 − t)³p₀ + 3t(1 − t)²p₁ + 3t²(1 − t)p₂ + t³p₃, for 0 ≤ t ≤ 1. The weights are non-negative and add to 1, so each point is a convex combination and the curve lies in the convex hull of its control points. The curve passes through the end control points with tangents 2(p₁ − p₀) or 3(p₁ − p₀) at the start. Joined cubics have G⁰ continuity when they share p₃, G¹ when p₂, p₃, p₄ are collinear with p₃ between, and C¹ when p₃ is the midpoint of p₂ and p₄. Repeated midpoints split a curve, and bicubic patches use 16 control points.
Flashcards
Flashcard
A curve defined by control points through Bernstein weights
Test your understanding
Question 1 of 5
A quadratic Bézier curve has p₀ = (0, 0), p₁ = (2, 4), p₂ = (4, 0). What is w(½)?
Question 2 of 5
A cubic Bézier curve has p₀ = (1, 1) and p₁ = (2, 3). What is its tangent vector x′(0)?
Question 3 of 5
Cubic x has control points p₀, …, p₃ with p₂ = (3, 5) and p₃ = (4, 4). The next cubic starts at p₃. Which p₄ gives C¹ continuity?
Question 4 of 5
In the situation of the previous question, what continuity does p₄ = (6, 2) give at the join?
Question 5 of 5
Why does a cubic Bézier curve always lie in the convex hull of its control points?
