Bézier Curves
Linear Bézier Curves
Let’s start with the simplest case, where there are only two control points P0 and P1.
The Bézier curve c approximating P0 and P1 is, simply, the straight line segment joining the two. We write the parametric equation of c as follows:
$c(u) = (1 - u)P_{0} + uP_{1}$ $(0 \leq u \leq 1)$(1)
The parametric equation (1.0) can be written as
$c(u) = B_{0,1}(u)P_{0} + B_{1,1}(u)P_{1}$ $(0 \leq u \leq 1)$(2)
where 1 - u (of the first control point) and u (of the second control point) are know as the Bernstein polynomials of degree 1. They are denoted by $B_{0,1}$ and $B_{1,1}$
Quadratic Bézier curves
Consider next three control points P0, P1 and P2. We want to construct the Bézier curve approximating these control points by means of a process of linear interpolation. Is there, though, an evident way to linearly interpolate a curve between three control points "simultaneously"? What does this even mean? A possibility, of course, is to linearly interpolate between P0 and P1 and then between P1 and P2, to get the two-segment polyline P0P1P2, which is not particularly attractive because of the corner at P1 (see Figure 15.3(a)). De Casteljau’s method, however, succeeds by adding a third interpolation step to "amalgamate" the two segments P0P1 and P1P2, smoothening thereby the corner. Here’s how it works.
(a) An "unhappy" way of approximating three control points (b) c(u) describes a Bézier curve of degree 2 interpolating $P_{0}$, $P_{1}$ and $P_{2}$ after a "triple" interpolation (c) Bernstein polynomials of degree 2: $B_{0,2}(u) = (1 - u)^{2}$, $B_{1,2}(u) = 2(1 - u)u$, $B_{2,2}(u) = u^{2}$
Given a u, $0 \leq u \leq 1$
- First interpolate between $P_{0}$ and $P_{1}$ to find the point
- $a(u) = (1 - u)P_{0} + uP_{1}$
- Next interpolate between $P_{1}$ and $P_{2}$ to find the point
- $b(u) = (1 - u)P_{1} + uP_{2}$
- Finally interpolate between a(u) and to determine the point
- $c(u) = (1 - u)a(u) + ub(u)$
Substituting the expressions for a(u) and b(u) into that for c(u), one obtains the parametric equation for a curve c:
$c(u) = (1 - u)^{2}P_{0} + 2(1 - u)uP_{1} + u^{2}P_{2}$ $(0 \leq u \leq 1)$(3)
The parametric equation (3) can be rewritten using the Bernstein polynomials of degree 2 as:
$c(u) = B_{0,2}(u)P_{0} + B_{1,2}(u)P_{1} + B_{2,2}(u)P_{2}$ $(0 \leq u \leq 1)$(4)
General Bézier Curves
The parametric equation for a Bézier curve c approximating n+1 controll points $P_{0}$, $P_{1}$, ...,$P_{n}$ is:
$c(u) = \sum_{i=0}^nB_{i,n}(u)P_{i}$$(0 \leq u \leq 1)$(4)
where $B_{i,n}(u)$, $(0 \leq i \leq n)$, called the ith Bernstein polynomials of degree n is given by
$\binom{n}{i}(1 - u)^{n-i}u^{i}$(5)
where $\binom{n}{i} = \frac{n!}{(n - i)!i!}$ is a binomial coefficient. The curve c is called a curve of degree n, or order n + 1
Bézier Surfaces
The parametric equation for a Bézier surface s approximating $(n + 1) \times (m + 1)$ array of control points is:
$s(u, v) = \sum_{i=0}^n\sum_{j=0}^mB_{i,n}(u)B_{j,m}(v)P_{i,j}$ $(0 \leq u \leq 1, 0 \leq v \leq 1)$(6)