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 11

Lesson 1: Modeling grass with parabolas

# 2. Midpoint formula

Explore how midpoints are used to describe the "string art construction.".

## Video transcript

- In the previous video, we saw how to use three points to define a parabolic arc. Later we'll talk about how to define the width, the color, the motion, and the variety that would be needed to create a convincing field of grass. But first, let's talk about what math we would need to create a computer program that our artists could use. A program like this one, for instance, where I can pull points around, and the parabola updates. So what kind of math is required underneath this program? First we need to talk about computing the locations of the points that we're going to connect together with the string art lines. Now, some of these points are a little bit easier to construct than others, and the easiest ones are the ones here, at the midpoints. So this point here is on the midpoint of this leg, and this point here is on the midpoint of this leg, and so on. So let's look at the mathematics of midpoints. So here I have a line segment, A B. The midpoint of that line segment is going to be somewhere in the middle. Like this yellow point here. Let's call that point Q. Now the question is, if I know the coordinates of A, suppose the coordinates of A are A sub x, and A sub y. Similarly suppose the coordinates of B are B sub x, and B sub y, then the question is, what are the coordinates of the midpoint Q? Well, if you think about it for a minute, you'll realize that Q is halfway between A and B in the x direction, and halfway between A and B in the y direction. We can compute a point like that by simple averaging. It is the x coordinate of Q is going to be the average of the x coordinates of A and B. So that's going to be Ax plus Bx over two. The y coordinate is going to be Ay plus By over 2. That's a very simple calculation. ^I can abbreviate it and make it look a little bit simpler, ^by writing Q as A plus B over 2. ^What this means is, ^take the average of x and the average of y. ^So these two expressions just mean the same thing. Now our string art construction requires more than just a pair of midpoints. But we can create as many points as we want, by computing midpoints of midpoints. For instance, here is just a pair of midpoints, and now I'm going to compute a midpoint on this subsegment, and another midpoint on this subsegment. Similarly for these two subsegments. So that gives me three points on each leg, and I can create as many as I want just by continuing this midpoint of midpoint process. Next, you'll have a chance to experiment with these ideas.