Explanation of De Casteljau Algorithm for Bézier Curves#
The De Casteljau algorithm is a method for evaluating points on a Bézier curve, which is widely used in computer graphics and animation due to its smoothness and flexibility.
Mathematical Basis#
A Bézier curve with \( n + 1 ) control points \( P_0, P_1, \ldots, P_n \) is defined by the parameter \( t \in [0, 1] \):
\( B(t) = \sum_{i=0}^{n} {n \choose i} (1-t)^{n-i} t^i P_i \)
The De Casteljau algorithm provides a recursive way to compute points on this curve by interpolating between control points.
Algorithm Steps#
Initialization: Start with the given set of control points \( P_0, P_1, \ldots, P_n \).
Recursive Interpolation:
- For each iteration, interpolate between pairs of adjacent control points based on the parameter \( t \).
- Compute new points until only one point remains, which gives the point on the Bézier curve at parameter \( t \).
Visualization:
- Draw the initial control points as red circles on a canvas.
- Draw lines connecting these points in gray to show intermediate steps of the algorithm.
- Calculate the Bézier curve up to the current frame and draw it in white, emphasizing its construction from the control points.
Example Animation#
Below is an interactive animation using the De Casteljau algorithm with 5 control points. Each frame of the animation shows the current state of interpolation, highlighting how the Bézier curve is constructed step by step.

