If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Pixar in a Box

### Course: Pixar in a Box>Unit 10

Lesson 2: Mathematics of animation curves

# 2. Repeated linear interpolation

First we'll review De Casteljau's algorithm using three points. Then it's your turn to figure out how to do it with 4 points!

## Want to join the conversation?

• At why would we want to use four points to control the animation?
• To create more realistic, more natural looking, animations.
• how do you do this in a hour
• You got to work fast , then you will be able to do this in an hour! Cheers :)
(1 vote)
• What Did any of this mean?
• This is just the boring math...Except using it to make amazing animations :)
• at which program is used in this video and can it be downloaded online
• Is the math behind animation even that important?
• I in 3rd grade and I don't know what algorithm is. Can any of you tell me? (or you could tell me what grade it is too)
(1 vote)
• Why are all these comments from like 5 years ago these things stress me out
(1 vote)
• Why should I use Castelijua's (tricky word) Algorithim if there are already Bezier curves?
(1 vote)
• at he talks about the stringar method. What is this?
(1 vote)
• String art is a technique used by artists for the creation of abstracted images which are composed of straight lines of strings. String art is a technique for the creation of visual artwork where images emerge from a set of strings that are spanned between pins.
(1 vote)
• I am on repeated linear interpretation. I get 100% right, but at the end it says 100% incorrect and won’t let me advance. What do I do ?
(1 vote)

## Video transcript

- Now that we've looked at linear interpolation, let's see how we can get smoother motion using Bézier 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 modeling 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 A B using a weighted average of these two end points. 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 out 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 deCastlejau's algorithm. It's named after Paul deCastlejau who actually discovered the math for this a few years before Pierre Bézier, but wasn't able to publish it until after Bézier had scooped in. We've seen how deCastlejau'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.