Advanced Placement
Skip to the notes

AP Precalculus

Topic 4.8: Vectors

Watch now21 min

Updated · For the May 2027 AP exam

Vectors: components, magnitude and direction, sums, unit vectors, the dot product and vector triangles. Bring a plane in to land through a strong crosswind, and work out why the pilot points the nose away from the runway.

Topic 4.8 key terms

vector
A quantity with a size and a direction, drawn as an arrow (a directed line segment) from its tail to its head. Its length is its magnitude.
component form
The vector from (x₁, y₁) to (x₂, y₂) is ⟨x₂ − x₁, y₂ − y₁⟩: end minus start. Sliding the arrow anywhere keeps the same components, so it is the same vector.
magnitude
The length of a vector: |⟨a, b⟩| = √(a² + b²), from Pythagoras. A vector ⟨a, b⟩ points the same way as the segment from the origin to (a, b).
zero vector
⟨0, 0⟩, the move from a point to itself: length 0 and no direction, so it has no unit vector.
components from length and angle
A vector of length r at angle θ from the positive x-axis is ⟨r cos θ, r sin θ⟩. The signs show the quadrant: 10 at 150° is ⟨−5√3, 5⟩.
vector addition
Add matching components: ⟨a₁, b₁⟩ + ⟨a₂, b₂⟩ = ⟨a₁ + a₂, b₁ + b₂⟩. On paper, put the second vector's tail on the first one's head; the sum runs from the first tail to the last head. |u + v| is usually not |u| + |v|.
scalar multiple
k⟨a, b⟩ = ⟨ka, kb⟩: every component is multiplied by k. The result is parallel to the original; a negative k flips its direction, and its length is |k| times as long.
unit vector
A vector of length 1. The unit vector in the direction of a nonzero v is v / |v|; every unit vector is ⟨cos θ, sin θ⟩.
î and ĵ
The unit vectors î = ⟨1, 0⟩ and ĵ = ⟨0, 1⟩. Every vector is built from them: ⟨a, b⟩ = aî + bĵ.
dot product
⟨a₁, b₁⟩ · ⟨a₂, b₂⟩ = a₁a₂ + b₁b₂, a number (not a vector). It equals |u||v|cos θ, where θ is the angle between u and v.
perpendicular vectors
Two nonzero vectors are perpendicular exactly when their dot product is 0 (because cos 90° = 0). A positive dot product means an acute angle, a negative one an obtuse angle.
Law of Cosines
In a triangle with sides a, b, c and angle C opposite c: c² = a² + b² − 2ab cos C. For a vector sum, C is the triangle's angle at the join, 180° minus the angle between the arrows.
Law of Sines
In any triangle, sin A / a = sin B / b = sin C / c: each side over the sine of the opposite angle gives the same ratio (two ways of computing one height).

Transcript

2,731 words · 8 parts

Pointed one way, flying another

There’s a storm blowing in off the sea tonight, and somewhere out there in the rain, a plane is coming in to land. It’s a minute from the runway and lined up perfectly with the approach lights, but its nose is turned way off to one side, as if the pilot were aiming for the grass next to the runway.

Nothing’s broken, and the pilot isn’t lost. A seventy-kilometer-an-hour wind is blowing straight across this runway, and the pilot has turned the nose into the wind on purpose, which pilots call crabbing. From the cockpit, the runway sits off to one side of the windshield, and that’s exactly where the pilot wants it.

From straight above, you can see what’s going on. The plane moves through the air the way its nose points, the air itself is sliding sideways across the runway, and the path the plane actually follows is those two motions added together. By the end of this lesson, you’ll be able to work out exactly how far to turn a plane into the wind so it lands right on the centerline.

And then you’ll fly the approach yourself, when the storm swings the wind around and it hits you from an angle. To do that, we need a way to describe a motion that has a size and a direction at the same time, and an arrow does just that.

An arrow is a move

Take just one of these arrows, the wind. Its length stands for how fast the air moves, seventy kilometers an hour, and it points the way the air is going. We call an arrow with a size and a direction a vector. It starts at its tail, it ends at its head, and we call its length its magnitude.

Let’s put one on a grid. This arrow starts at P, negative two, one, and ends at Q, one, five. Think of it as a move. From P to Q you go three to the right, because one minus negative two is three, and four up, because five minus one is four. So we write this vector as three, four, in angle brackets, and those two numbers are its components.

Its length comes from Pythagoras, the square root of three squared plus four squared, which is five. A vector doesn’t care where it starts. Slide this arrow so it starts at four, negative three, and it’s still three right and four up, so it’s the very same vector. Start it at the origin and its head lands on the point three, four, so wherever you draw it, it points the same way as the segment from the origin to that point.

But the point three, four is a place. The vector three, four is a move you can make from anywhere. And a move from a point to itself is zero, zero, the zero vector, with no length and no direction. So the vector from one point to another is end minus start, and its magnitude is the square root of the sum of the squares of its components. Now that P and Q have moved, which vector takes you from P to Q?

Two motions at once

So let’s go back to the plane and ask the obvious question. What happens if the pilot just points the nose straight down the runway? It moves through the air at two hundred fifty, straight along the centerline, but the wind carries it sideways at seventy the whole time, and it drifts off the side of the runway.

Let’s measure x along the runway and y straight across it. Then the plane’s own motion is two hundred fifty, zero, and the wind is zero, seventy. To add two vectors, you slide the second one so its tail sits on the head of the first, and the sum runs from the first tail to the last head, which here is two hundred fifty, seventy.

The plane doesn’t fly one arrow and then the other, since both happen at once, but drawing them tail to head is how you add them. If a gust doubles the wind, its arrow doubles too, to zero, one hundred forty, pointing the same way, and the drift gets steeper. Let’s put this on paper.

Adding vectors just means adding matching components, so it’s two hundred fifty plus zero along the runway and zero plus seventy across it, which makes two hundred fifty, seventy. So how fast is the plane really going over the ground? It’s tempting to say three hundred twenty, but that only works when the two arrows point the same way.

The ground arrow is the long side of a right triangle with legs two hundred fifty and seventy, so its length is about two hundred sixty kilometers an hour, barely faster than the plane flies on its own. When the gust doubled the wind, we multiplied the vector by two, and that multiplies each component. A positive number stretches or shrinks an arrow along its own line, and a negative number also flips it around, so either way the new vector is parallel to the old one.

Aim into the wind

So how does the pilot stay on the centerline? Nobody can change the wind, but the pilot can turn the nose, and the plane always flies at two hundred fifty through the air. That means the head of the plane’s arrow can only slide around this circle, and the question is which point on it makes the ground arrow lie right along the runway. Turn the nose until the plane tracks straight down the centerline.

Let’s find that angle exactly. For no sideways motion over the ground, the plane’s sideways part has to be negative seventy, so that it cancels the wind. The plane’s arrow still has a length of two hundred fifty, so by Pythagoras its other component is the square root of two hundred fifty squared minus seventy squared, which is exactly two hundred forty.

So the plane’s arrow is two hundred forty, negative seventy, and it covers the ground at only two hundred forty kilometers an hour, because part of its motion goes into canceling the wind. The angle, call it beta, comes from the same right triangle, where the sine of beta is seventy over two hundred fifty, so beta is about sixteen degrees, right where the nose ended up.

This works backwards, too. If you know a vector’s length r and its angle theta, measured counterclockwise from the positive x-axis, its components are r cosine theta and r sine theta, just like polar coordinates. For the plane’s arrow, that’s two hundred fifty at about negative sixteen degrees, which gives back two hundred forty, negative seventy. Here’s an arrow of length ten at one hundred fifty degrees. Its components are ten cosine one hundred fifty and ten sine one hundred fifty.

The cosine of one hundred fifty is negative root three over two and its sine is one half, so that’s negative five root three, five. That negative first component isn’t a mistake, because it’s what tells you the arrow points left. A twenty-kilometer-an-hour wind blows toward one hundred twenty degrees. What’s its component form?

Just the direction

Sometimes you care only about which way something is, not how far, and every video game runs into that. A guard like this sentry has to decide, many times a second, whether you’re in front of it, where it can spot you, or behind it. Here’s how the game itself sees the room, with floor tiles one meter wide. The sentry is at two, one, and the player is crouched at five, five.

The arrow from the sentry to the player is end minus start, three, four, the same vector we drew on the grid, so it’s five meters long. But for front or behind, the distance doesn’t matter, only the direction, so the game shrinks the arrow along its own line until its length is exactly one. It divides by the length, so three, four becomes three fifths, four fifths, or zero point six, zero point eight, and its head lands on a circle of radius one.

An arrow of length one is a unit vector. To get one, divide any nonzero vector by its own length. Its length becomes one, and its direction stays the same. Its head is on the unit circle, so every unit vector is cosine theta, sine theta for some angle theta. The zero vector is the one exception, because it has no direction to keep, and you can’t divide by a length of zero.

Two unit vectors get special names, i hat, which is one, zero, and j hat, which is zero, one, and you can build every vector out of them, so three, four is three i hat plus four j hat. The plane’s arrow from the storm is two hundred forty i hat minus seventy j hat. What’s the unit vector in the direction of six, negative eight?

One number from two arrows

Now say the sentry is facing straight along x, so its facing direction is the unit vector one, zero. To decide whether you’re in front, the game multiplies the matching components of the two unit arrows and adds them, one times zero point six plus zero times zero point eight, which is zero point six. It’s positive, so the player is in front, and as they creep around, it hits zero right when they’re exactly beside the sentry, and goes negative once they’re behind.

That number has a picture. Drop a line from the head of the player’s unit arrow onto the sentry’s line of sight, meeting it at a right angle, and the shadow the arrow casts on that line is the number. For two unit arrows, that shadow is the cosine of the angle between them, so it’s positive under ninety degrees, zero at ninety, and negative past it.

Most game guards see only a wedge, though. If this one sees sixty degrees, thirty to each side, it spots you when the number reaches the cosine of thirty degrees, about zero point eight seven, so at zero point six the player is safe. But if the sentry turns to face the player, the number climbs all the way to one, and that’s game over.

Now the whole crew is in the room, and the sentry is facing zero point six, zero point eight. Only the sign matters, so you can use their arrows without shrinking them. Which one is behind it?

We call that multiply-and-add the dot product, and for any two vectors it’s a one times a two plus b one times b two. For one, two and three, one, it’s three plus two, which is five, and notice that the answer is a number, not an arrow. So why does multiplying and adding give a cosine? Write two unit vectors as cosine alpha, sine alpha and cosine gamma, sine gamma.

Their dot product is cosine alpha cosine gamma plus sine alpha sine gamma, and that’s the difference identity you already know, the cosine of alpha minus gamma, which is the cosine of the angle between them. Every vector is its length times a unit vector. Those two lengths just multiply the answer. That makes u dot v the length of u, times the length of v, times the cosine of the angle between them.

That gives you the angle between any two nonzero vectors. For one, two and three, one, the lengths are root five and root ten, so cosine theta is five over root five times root ten, one over root two, which makes the angle forty-five degrees. If neither length is zero, a dot product of zero means cosine theta is zero, so theta is ninety degrees. Three, four and four, negative three give twelve minus twelve, so they’re perpendicular.

For nonzero vectors that works both ways, and the zero vector is the exception, since its dot product with anything is zero. When the dot product isn’t zero, its sign tells you the rest, positive when the angle is less than ninety degrees and negative when it’s more. What value of k makes the vector k, three perpendicular to the vector six, negative four?

The wind swings around

Back in the storm, the plane lines up for one more approach, and the wind is swinging around. It’s still seventy kilometers an hour, but now it comes from ahead and to the right, thirty degrees off the nose, so a plane pointed straight down the runway drifts sideways and slows down.

This time the triangle won’t be a right triangle, and it hides a trap. The angle between the two arrows is one hundred fifty degrees, but once the wind arrow slides to the head of the plane’s arrow, the angle inside the triangle is the one on the other side of the line, thirty degrees. Let’s solve it on paper.

The tool for this is the Law of Cosines, and it comes straight out of the dot product. Square the length of a plus w, and multiply it out. The middle term carries the cosine of one hundred fifty degrees. Cosine one fifty is minus cosine thirty, so the plus turns into a minus. That’s the Law of Cosines, with the triangle’s own angle, thirty degrees.

With the numbers in, the plane crosses the ground at about one hundred ninety-three kilometers an hour. Use one hundred fifty with the minus sign instead and you’d get about three hundred thirteen, faster than the plane flies, into a headwind, which can’t be right.

Now let’s fix the drift. Turn the nose into the wind by an angle we’ll call beta. The wind arrow goes on its head, and the ground arrow runs straight down the runway. Look at the far corner, where the wind arrow comes down onto the runway line. It crosses that line at thirty degrees, out past the corner.

Which angle is inside the triangle at that far corner? In the first triangle, the arrows met head to tail, and thirty was inside. Here two arrowheads meet, and the wide angle, one hundred fifty, is inside. The wind arrow is the long side of a small right triangle, with that thirty degree angle. Its sideways part is seventy sine thirty, which is thirty-five.

The plane’s arrow ends at the bottom of that same dashed line, so its sideways part, two hundred fifty sine beta, is thirty-five too. Sine one fifty equals sine thirty, so with sines that trap can’t bite. With the triangle’s own angle, the right side is seventy sine one fifty. Divide both sides, and each angle’s sine sits over the side across from it. That’s the Law of Sines.

Sine beta is thirty-five over two hundred fifty, or zero point one four. That’s about eight degrees. The corner where the arrows join gets the other twenty-two. So eight degrees to the right, into the wind, is your number, and this time there are no arrows, just the instruments. Set the heading and fly the approach.

And here it comes, crabbed all the way in, and in the last second the pilot straightens the nose with the rudder, so the wheels roll straight down the centerline. This time it crossed the ground at about one hundred eighty-seven kilometers an hour. That’s slower than the first approach’s two hundred forty, because part of this wind is a headwind.

What the arrows told us

So a vector is a size and a direction, and its components come from end minus start, or from its length and angle, with cosine and sine. Vectors add one component at a time, tail to head on paper, and a number times a vector multiplies every component and keeps it parallel.

Divide by the length to get a unit vector, and build any vector from i hat and j hat. The dot product multiplies and adds, and it equals the two lengths times the cosine of the angle between them, so for nonzero vectors, zero means perpendicular. And the Laws of Cosines and Sines solve the triangles vectors make, as long as you use the triangle’s own angles.

You’ll use all of this in physics, where forces add just like the wind and the plane, and in game engines, where dot products decide what a character sees. And you can now do what you came for, which is to point a plane into the wind and land it right on the centerline.

Unit 4: Functions Involving Parameters, Vectors, and Matrices

  1. 4.1Parametric Functions
  2. 4.2Parametric Functions Modeling Planar Motion
  3. 4.3Parametric Functions and Rates of Change
  4. 4.4Parametrically Defined Circles and Lines
  5. 4.5Implicitly Defined Functions
  6. 4.6Conic Sections
  7. 4.7Parametrization of Implicitly Defined Functions
  8. 4.8Vectors
  9. 4.9Vector-Valued Functions
  10. 4.10Matrices
  11. 4.11The Inverse and Determinant of a Matrix
  12. 4.12Linear Transformations and Matrices
  13. 4.13Matrices as Functions
  14. 4.14Matrices Modeling Contexts