In the
mathematical
Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
field of
numerical analysis
Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic computation, symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of ...
, De Casteljau's algorithm is a
recursive
Recursion occurs when the definition of a concept or process depends on a simpler or previous version of itself. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in m ...
method to evaluate polynomials in
Bernstein form
In the mathematical field of numerical analysis, a Bernstein polynomial is a polynomial expressed as a linear combination of Bernstein basis polynomials. The idea is named after mathematician Sergei Natanovich Bernstein.
Polynomials in Bernste ...
or
Bézier curve
A Bézier curve ( , ) is a parametric equation, parametric curve used in computer graphics and related fields. A set of discrete "control points" defines a smooth, continuous curve by means of a formula. Usually the curve is intended to approxima ...
s, named after its inventor
Paul de Casteljau
Paul de Casteljau (19 November 1930 – 24 March 2022) was a French physicist and mathematician. In 1959, while working at Citroën, he developed an algorithm for evaluating calculations on a certain family of curves, which would later be formali ...
. De Casteljau's algorithm can also be used to split a single Bézier curve into two Bézier curves at an arbitrary parameter value.
The algorithm is
numerically stable when compared to direct evaluation of polynomials. The computational complexity of this algorithm is
, where d is the number of dimensions, and n is the number of control points. There exist faster alternatives.
Definition
A Bézier curve
(of degree
, with control points
) can be written in Bernstein form as follows
where
is a
Bernstein basis polynomial
The curve at point
can be evaluated with the
recurrence relation
In mathematics, a recurrence relation is an equation according to which the nth term of a sequence of numbers is equal to some combination of the previous terms. Often, only k previous terms of the sequence appear in the equation, for a parameter ...
Then, the evaluation of
at point
can be evaluated in
operations. The result
is given by
Moreover, the Bézier curve
can be split at point
into two curves with respective control points:
Geometric interpretation
The geometric interpretation of De Casteljau's algorithm is straightforward.
*Consider a Bézier curve with control points
. Connecting the consecutive points we create the control polygon of the curve.
*Subdivide now each line segment of this polygon with the ratio
and connect the points you get. This way you arrive at the new polygon having one fewer segment.
*Repeat the process until you arrive at the single point – this is the point of the curve corresponding to the parameter
.
The following picture shows this process for a cubic Bézier curve:
Note that the intermediate points that were constructed are in fact the control points for two new Bézier curves, both exactly coincident with the old one. This algorithm not only evaluates the curve at
, but splits the curve into two pieces at
, and provides the equations of the two sub-curves in Bézier form.
The interpretation given above is valid for a nonrational Bézier curve. To evaluate a rational Bézier curve in
, we may project the point into
; for example, a curve in three dimensions may have its control points
and weights
projected to the weighted control points
. The algorithm then proceeds as usual, interpolating in
. The resulting four-dimensional points may be projected back into three-space with a
perspective divide.
In general, operations on a rational curve (or surface) are equivalent to operations on a nonrational curve in a
projective space
In mathematics, the concept of a projective space originated from the visual effect of perspective, where parallel lines seem to meet ''at infinity''. A projective space may thus be viewed as the extension of a Euclidean space, or, more generally ...
. This representation as the "weighted control points" and weights is often convenient when evaluating rational curves.
Notation
When doing the calculation by hand it is useful to write down the coefficients in a triangle scheme as
When choosing a point ''t''
0 to evaluate a Bernstein polynomial we can use the two diagonals of the triangle scheme to construct a division of the polynomial