# More Bezier splines Math

Bernsein polynomials have next useful properties

*∑*_{i=0,n}
B_{i}^{n}(t) = 1, (partition of unity)

B_{i}^{n}(t) ≥ 0,
0 ≤ t ≤ 1

from this it follows

*B*_{i}^{n}(t) ≤ 1,
0 ≤ t ≤ 1

and

*B*_{0}^{n}(0) = 1,
B_{i}^{n}(0) = 0,

B_{n}^{n}(1) = 1,
B_{i}^{n}(1) = 0.

Derivatives

^{d}/_{dt} B_{i}^{n}(t) =
n ( B_{i-1}^{n-1}(t) - B_{i}^{n-1}(t) ).
## Affine Invariance

From the de Casteljau algorithm it follows that,
any linear transformation (such as rotation or scaling) or translation of
control points defines a new curve that is just the transformation or
translation of the original curve (i.e. Bezier curve is *affinely
invariant* with respect to its control points).
## Convex hull

As linear interpolated points are contained in the convex hull of control
points, then the Bezier curve is contained in the convex hull of its
control points too.
## Linear Precision

If all the control points form a straight line, the
curve also forms a line. This follows from the convex hull property;
as the convex hull becomes a line, so does the curve.

Moreover, you can test by hand, that for cubic Bernstein polynomials

*0 B*_{0}^{3}(t) +
1/3 B_{1}^{3}(t) + 2/3 B_{2}^{3}(t) +
B_{3}^{3}(t) = t.

Therefore for control points with coordinates

*P*_{0,x} = 0, P_{1,x} = 1/3,
P_{2,x} = 2/3, P_{3,x} = 1

we get identical mapping (I used this as *"1/3 rule"*)

*P*_{x}(t) = t.
## Differentiation of the Bezier curve

Derivative of a curve gives the tangent vector at a point. From

^{d}/_{dt} B_{i}^{n}(t) =
n ( B_{i-1}^{n-1}(t) - B_{i}^{n-1}(t) )

it follows that the derivatives at the endpoints of the Bezier curve are

**P**'(0) = n (**P**_{1} - **P**_{0} ),
**P**'(1) = n (**P**_{n} - **P**_{n-1} ).

Therefore the Bezier curve is tangent to the first and last segments
of the control polygon, at the first and last control points. In fact,
these derivatives are *n* times the first and last legs of the
control polygon.

The second derivatives are

**P**"(0) = n(n-1)(**P**_{2} -
2**P**_{1} + **P**_{0} ),
**P**"(1) = n(n-1)(**P**_{n} -
2**P**_{n-1} + **P**_{n-2} ).
## Deriving deCasteljau algorithm

We use Bernstein polynomials recurrence relations to get the first step of
deCasteljau iterations

**P**(t) = **P**_{0}^{n} =
∑_{i=0,n} B_{i}^{n}
**P**_{i} = ∑_{i=0,n}
**P**_{i} [ (1 - t)B_{i}^{n-1} +
tB_{i-1}^{n-1}] =

(1 - t)∑_{i=0,n-1}
**P**_{i} B_{i}^{n-1} +
t∑_{i=0,n-1}
**P**_{i+1} B_{i}^{n-1} =
(1 - t)**P**_{0}^{n-1} + t**P**_{1}^{n-1}
,

where

* ***P**_{m}^{k} =
∑_{i=0,k} B_{i}^{k}
**P**_{i+m} .

In a similar way we get the general deCasteljau equation for
**P**_{m}^{k}.

Contents
Previous: Bezier spline curves
Next: Interpolating Lagrange curve

*updated* 7 August 2001