Main content
Course: Pixar in a Box > Unit 2
Lesson 2: Mathematics of animation curves- Start here!
- Linear interpolation
- Repeated linear interpolation
- 1. Mathematics of linear interpolation
- 3. De Casteljau's algorithm
- Construção de curvas usando interpolação linear repetida
- 4. What degree are these curves?
- Bonus: Equations from de Casteljau's algorithm
© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice
Repeated linear interpolation
Introduction to de Castlejau's algorithm using three points.
Video transcript
- Now that we've looked
at linear interpolation, let's see how we can get smoother motion using Bezier curves. The shape of each segment of this curve is controlled by four points. So, how can we write an equation that gives us a smooth curve
out of these four points? You may remember we
faced a similar problem in the environment modelling lesson. There we were trying to
make curved blades of grass. We saw how to use three points
to define a parabolic arc using the string art method. So let's review how that string
art method actually works. Let's label our points A, B, and C. We've also got a parameter we'll call t, which is how far along
each line segment we are. First, we can calculate a point on AB using a weighted average
of these two endpoints. This is another kind of
linear interpolation, but instead of using the
slope-intercept form, we're using what's
called a parametric form. The parameter is t, which tells us how far
along the line we are. As t goes from zero to one, our new point, let's call it Q, goes from A to B. Let's do the same thing
for the other line segment, calculating a point R between B and C. Finally, we'll use the
same method between Q and R to calculate P, which is a point on our curve. As t goes from zero to one, P traces up the smooth curve. You can think of this construction method as repeated linear interpolation, since Q, R, and P are all computed using linear functions of t. This method of repeated
linear interpolation is called de Casteljau's algorithm. It's named after Paul de Casteljau, who actually discovered the math for this a few years before Pierre Bezier, but wasn't able to publish it until after Bezier had scooped him. We've seen how de Casteljau's
algorithm can be used to make a smooth curve
out of three points, but for animation we
want to use four points to control the curve. Take a few minutes with pencil and paper and see if you can work out how to get a smooth curve starting with four
points instead of three.