There is another very interesting page on bezier curves which goes all the way into the maths you need, i.e. finding intersections, length of a curve, splitting a curve, etc. It's not animated but interactive, so drag the control points.
No, I'm pretty sure I made them animated, and added a big red text over the sketches to make sure you know they are, saying "Animated sketch, click to play" =D
The same simple explanation in the animation leads to a nice simple Haskell implementation.
Assuming you already have a parametric line function `line p q t` that interpolates between two points p and q on t in [0,1], you can recursively implement parametric Bézier on a list of control points as:
bezier [p] t = p
bezier ps t = line (bezier (init ps) t)
(bezier (tail ps) t)
t
It's exponential in the number of points though ;)
As a (2D) game developer I love bezier curves. So many uses. My favorite may be that you can calculate the curve from just the end points if you know the velocity you want the object moving along the curve to have at the end.
Thank you. This gives a beautiful understanding of Bézier curves.
One request:
Please add pause/resume in the animation. I could just pause at any given time, and go through the state of all points. I hope it would help anyone to understand it much easily.