The Bernstein polynomials that form a basis
for Bezier curves, from kapittel 4.4.1 in *Blending techniques in Curve
and Surface constructions*

A Bezier curve is expressed by the
following formula: \( C(t) = \displaystyle\sum_{i=0}^{d} b_{d,i}(t)\ c_i \), where
\(d\) is the degree of the polynomial , and where \(c_i\) are
\(d+1\) control points and \(b_{d,i}(t)\) er \(d+1\) scalar Bernstein
polynomials/basis functions. In the figure above, a set of Bernstein
polynomials/basis functions is plotted. Note that the parameter domain is
\([0,\ 1]\). In the figure below, we have a set of \(d+1\) control points
\(p_i,\ i=0,1,...,d\) which are marked as gray pentagons. Thin black line
segments are plotted between the points. Together, these line segments
form a control polygon.

- In the menu at the top right, you can determine the degree \(d\).

- In the figure below, you can move the control points by pressing the left mouse button when the cursor is over one of the gray pentagons that represent a control point. The pentagon moves as long as you hold the button down. When you release the button, the pentagon is locked and the curve is updated.

The plot is programmed according to chapter 4.4 in the book.

A 3rd degree Bezier curve will have the following formula in matrix form:

\( C(t) = \begin{bmatrix}1- t & t \end{bmatrix} \begin{bmatrix} 1- t & t & 0 \\ 0 & 1- t & t \end{bmatrix} \begin{bmatrix} 1- t & t & 0 & 0 \\ 0 & 1- t & t & 0 \\ 0 & 0 & 1- t & t \end{bmatrix} \begin{bmatrix} c_{0} \\ c_{1} \\ c_{2} \\ c_{3} \end{bmatrix}\), when \(t \in[0, 1]\), se kapittel 4.4.2 i boka. If we want to increase the degree, we just add a new matrix to the right in front of the control points.

The matrix formula above can be written more compactly as \( C(t) = T^3(t)\ \mathbf{c} \), and we can calculate the 1st derivative in the usual way, i.e. with the kernel rule: \( C'(t) = 3\ T^2(t)\ T' \mathbf{c} \). In matrix form it becomes:

\( C'(t) = 3 \begin{bmatrix}1- t & t \end{bmatrix} \begin{bmatrix} 1- t & t & 0 \\ 0 & 1- t & t \end{bmatrix} \begin{bmatrix} -1 & 1 & 0 & 0 \\ 0 & -1 & 1 & 0 \\ 0 & 0 & -1 & 1 \end{bmatrix} \begin{bmatrix} c_{0} \\ c_{1} \\ c_{2} \\ c_{3} \end{bmatrix}\), when \(t \in[0, 1]\), see expression 4.36 i boka, which also shows the formulas for all derivatives.

If we multiply the 3 matrices in the matrix formula of the Bezier curve
we get 4 Bernstein polynomials of degree 3: \((1-t)^3\), \(
3t(1-t)^2\), \(3t^2(1-t)\) and \(t^3\). Set up
in a different matrix form, the Bernstein polynomials are: \(
\begin{bmatrix} 1 & -3 & 3 & -1\\ 0 & 3 & -6 & 3\\
0 & 0 & 3 & 3\\ 0 & 0 & 0 & 1 \end{bmatrix}
\begin{bmatrix} 1 \\ t\\ t^2 \\ t^3 \end{bmatrix} \). The
matrix in the expression is then the basis change matrix from a monomial
3rd-degree basis to a Bezier basis, i.e. Bernstein polynomials of degree
3. See table 4.1 i*n the book.*