de Casteljau curves
We can find the Bezier curve in another way as well, with the de Casteljau algorithm.
The starting point is the parametrical shape on a line that is in way so that P(0)=P0 and P(1)=P1: P(t)=(1-t)P0+tP1. A reasoning based on de Casteljau's algorithm leads to this being perceived as special case of a Bezier curve, a linear Bezier curve.
The algorithm can be described after the following scheme, where we imagine that t runs from 0 to 1:
P(t)=(1-t)P0+tP1 |
|
P(t)=(1-t)A(t)+tB(t) and: A(t)=(1-t)P0+tP1 B(t)=(1-t)P1+tP2 We fill in and get: P(t)=(1-t)2P0+2t(1-t)P1+t2P2 |
|
P(t)=(1-t)D(t)+tE(t) and:
D(t)=(1-t)A(t)+tB(t) and:
A(t)=(1-t)P0+tP1 We fill in two rounds and get: P(t)=(1-t)3P0+3t(1-t)2P1+3t2(1-t)P2+t3P3 |
The last expression is the same as the one we reached above, when we used a general polynomial of third degree and constraints for the endpoints and the derivative in the endpoints as a starting point.
It is easy to convince oneself that we can repeat the de Casteljau algorithm with further control points, P4, P5 etc.
You can animate the de Casteljau algorithm with 4 control points in the canvas below. Move the points and start the animation.
Move the controlpoints and dragh the bottom text with the mouse