Skip to content

38. Bezier Curves

Dated: 05-07-2025

In the early 1960s, Peter Bezier began looking for a better way to define curves and surfaces one that would be useful to a design engineer.

A Geometric Construction

cs602_e_38_1.svg

Select 3 points \(A, B\) and \(C\).

cs602_e_38_2.svg

Select 2 points \(D\) and \(E\) such that \(\frac {|\overline{AD}|}{|\overline{AB}|} = \frac {|\overline{BE}|}{|\overline{BC}|} = u_i\)

cs602_e_38_3.svg

Select \(F\) such that \(\frac {|\overline{DF}|}{|\overline{FE}|} = u_i\), the curve is traced by \(F\).

Let \(A = (x_A, y_A)\) and \(B = (x_B, y_B)\) then coordinates of \(D\) and \(E\) are

\[ \begin{aligned} x_D = x_A + u_i(x_B - x_A) \\ y_D = y_A + u_i(y_B - y_A) \end{aligned} \]
\[ \begin{aligned} x_E = x_B + u_i(x_C - x_B) \\ y_E = y_B + u_i(y_C - y_B) \end{aligned} \]

Similarly, for \(F\), we have

\[ \begin{aligned} x_F = x_D + u_i(x_E - x_D) \\ y_F = y_D + u_i(y_E - y_D) \end{aligned} \]

Substituting coordinates for \(D\) and \(E\) in \(F\) and after simplification, we have

\[ \begin{aligned} x_F = (1-u_i)^2 x_A + 2u_i(1-u_i) x_B + u_i^2 x_C \\ y_F = (1-u_i)^2 y_A + 2u_i(1-u_i) y_B + u_i^2 y_C \end{aligned} \]

To generalize

\[ \begin{aligned} x(u) = x_F \\ y(u) = y_F \\ \end{aligned} \]
\[ \begin{array}{ccc} x_0 = x_A & x_1 = x_B & x_2 = x_C \\ y_0 = y_A & y_1 = y_B & y_2 = y_C \\ \end{array} \]
\[ \begin{aligned} x(u)=(1-u)^2 x_0 + 2u(1-u)x_1 + u^2 x_2 \\ y(u)=(1-u)^2 y_0 + 2u(1-u)y_1 + u^2 y_2 \end{aligned} \]
\[ p(u) = (1-u)^2 p_0 + 2u(1-u)p_1 + u^2 p_2 \]

Where \(A = p_0, B = p_1, C = p_2\).

This is the set1 of second-degree equations for the coordinates of points on Bezier curve based on our construction.

The degree of a Bezier curve is equal to \(n - 1\), where \(n\) is the number of control points.

Cubic version

\(p(u) = (1-u)^3 p_0 + 3u(1-u)^2 p_1 + 3u^2(1-u)p_2 + u^3 p_3\)

\[p(u) = \sum_{i = 0}^n \binom{n}{i} u^i(1 - u)^{n - i} p_i \quad n = \text{Degree of Bezier curve}\]

An Algebraic Definition

Bezier began with the idea that any point \(p(u)\) on a curve segment should be given by an equation such as the following

\[ p(u) = \sum_{i=0}^n p_i f_i(u) \]

cs602_i_38_1.png

Source: gamemath.com

The \(f_i(u)\) has following important characteristics.

  • The curve must start on the first control point, \(p_0\), and end on the last, \(p_n\). Mathematically, we say that the functions must interpolate these two points.
  • The curve must be tangent2 to the line3 given by \(p_1 - p_0\) at \(p_0\) or \(p_n - p_{n - 1}\) at \(p_n\).
  • The functions4 \(f_i(u)\) must be symmetric with respect to \(u\) and \((1 - u)\). This lets us reverse the sequence of control points without changing the shape of the curve.

cs602_i_38_2.png

Effect of reversing the order of control points on the curve.

We can rewrite the equation as

\[ p(u) = \sum_{i=0}^n p_i B_{i,n}(u) \]
\[ B_{i,n}(u) = \binom{n}{i} u^i (1-u)^{n-i} \]

where

\[ \binom{n}{i} = \frac{n!}{i!(n-i)!} \]

Expanding this equation for second degree Bezier curve, we have

\[ p(u) = p_0 B_{0,2}(u) + p_1 B_{1,2}(u) + p_2 B_{2,2}(u) \]
\[ \begin{aligned} B_{0,2}(u) & = (1-u)^2 \\ B_{1,2}(u) & = 2u(1-u) \\ B_{2,2}(u) & = u^2 \\ \end{aligned} \]

similarly, for \(n = 3\)

\[ p(u) = p_0 B_{0,3}(u) + p_1 B_{1,3}(u) + p_2 B_{2,3}(u) + p_3 B_{3,3}(u) \]
\[ \implies p(u) = (1-u)^3 p_0 + 3u(1-u)^2 p_1 + 3u^2(1-u)p_2 + u^3 p_3 \]
\[ \implies \begin{aligned} B_{0,3}(u) & = (1-u)^3 \\ B_{1,3}(u) & = 3u(1-u)^2 \\ B_{2,3}(u) & = 3u^2(1-u) \\ B_{3,3}(u) & = u^3 \end{aligned} \]
\[ \implies p(u) = \begin{bmatrix} (1-u)^3 \\ 3u(1-u)^2 \\ 3u^2(1-u) \\ u^3 \end{bmatrix}^T \begin{bmatrix} p_0 \\ p_1 \\ p_2 \\ p_3 \\ \end{bmatrix} \]
\[ \begin{bmatrix} (1-3u+3u^2-u^3) \\ (3u-6u^2+3u^3) \\ (3u^2-3u^3) \\ u^3 \end{bmatrix}^T \begin{bmatrix} p_0 \\ p_1 \\ p_2 \\ p_3 \end{bmatrix} \]
\[ \begin{array}{cccc} p(u) = & \begin{bmatrix} u^3 & u^2 & u & 1 \end{bmatrix} & \begin{bmatrix} -1 & 3 & -3 & 1 \\ 3 & -6 & 3 & 0 \\ -3 & 3 & 0 & 0 \\ 1 & 0 & 0 & 0 \end{bmatrix} & \begin{bmatrix} p_0 \\ p_1 \\ p_2 \\ p_3 \end{bmatrix} \\ & \Big \downarrow & \Big \downarrow & \Big \downarrow \\ & U & M & P \end{array} \]
\[p(u) = UMP\]

References


  1. Read more about sets

  2. Read more about vectors

  3. Read more about lines

  4. Read more about functions