Vectors

Some things are just a number. The temperature is $72^\circ$, the movie is $2$ hours long, the room is $300$ square feet. But try describing the wind with one number. "Fifteen miles per hour" is only half the story: fifteen miles per hour which way? Force, velocity, and wind all need a size and a direction, and the object that carries both is a vector.

Here's the one idea that runs through this whole page: a vector is a move. "Go $3$ right and $4$ up" is a move, and it doesn't care where you start. Every rule below, adding, scaling, subtracting, even the dot product, is a fact about making moves on graph paper, so every example comes with its picture: watch the moves happen, then do the arithmetic.

The practice is mixed into the lesson: each question sits right after the idea it needs, and the Mixed Practice at the bottom takes that hint away. Flip the switch on a question to type your answer instead: vectors like <3, -4> or 3i - 4j, square roots like 2sqrt(5), and angles in degrees like 135.

A Vector Is a Move

To draw something with a size and a direction, use an arrow: its length is the size and it points in the direction. An arrow from a point $A$ to a point $B$ is a directed line segment, written $\overrightarrow{AB}$, with initial point $A$ (the tail) and terminal point $B$ (the tip). Here's the twist: we don't care where the arrow is drawn. Slide it anywhere you like, and as long as it keeps its length and direction, it describes the same thing.

Two directed line segments are equivalent if they have the same length and the same direction. A vector $\vec{v}$ in the plane is the set of all directed line segments equivalent to a given one, $\overrightarrow{AB}$. We write $\vec{v} = \overrightarrow{AB}$.

So a vector isn't one arrow, it's the whole family of identical arrows. Any one of them can stand in for the rest. Watch one arrow stamp out copies of itself:

Every copy is $3$ squares right and $2$ squares up, so they're all the same vector. The copy whose tail sits on the origin is the one we'll usually draw: that's the vector in standard position. Here's how to check two arrows by hand.

A vector is an arrow I'm allowed to pick up and carry anywhere, as long as I don't turn it or stretch it. The world's strictest moving company.

Graph the vector $\vec{u}$ from $A = (0, 0)$ to $B = (3, 4)$, and the vector $\vec{v}$ from $C = (1, 2)$ to $D = (4, 6)$. Are they equivalent?


From $A$ to $B$: $3$ right and $4$ up. From $C$ to $D$: $4 - 1 = 3$ right and $6 - 2 = 4$ up. Same moves, so the arrows have the same length and direction. They're equivalent: $\vec{u} = \vec{v}$.

Notice the trick we just used: instead of measuring lengths and angles, we counted "how far right" and "how far up." Those two numbers pin a vector down completely.

Component Form and Length

Every vector can be described by its run and its rise. That gives the most useful way to write one down.

The component form of the vector with initial point $A = (a_1, a_2)$ and terminal point $B = (b_1, b_2)$ is $$\vec{v} = \overrightarrow{AB} = (b_1 - a_1, \, b_2 - a_2) = (v_1, v_2).$$ The numbers $v_1$ and $v_2$ are the components of $\vec{v}$.

Terminal minus initial, tip minus tail, every time. And when the vector sits in standard position, its tip is just the point $(v_1, v_2)$:

Two vectors are equal exactly when their components match: $(u_1, u_2) = (v_1, v_2)$ means $u_1 = v_1$ and $u_2 = v_2$. Notice that a vector's components look exactly like a point's coordinates. That's on purpose, and the Pro Tip says how to keep them apart.

Keep the roles straight: the point $P = (3, 4)$ is a location, but $\vec{v} = (3, 4)$ is a move: "3 right, 4 up," starting from anywhere. The arrow on the letter tells you which one you're holding. (The move from the origin to $P$ is exactly $(3, 4)$, which is why the two can share a look.) And the classic slip is subtracting backwards: initial minus terminal flips both signs and points your arrow the wrong way. (Many precalculus books put components in angle brackets, ⟨3, 4⟩, just to keep vectors and points apart; others write vectors in bold, v, or with a hat or a harpoon on top. Same idea.)

Try it with your hands. Drag the two endpoints and watch the components change. The missions are about which part of the picture the vector actually cares about:

Tip Minus Tail

The second mission is the point of this whole section: you moved both points and the vector didn't change, because the vector only knows the move. The run and rise also make a right triangle with the arrow as its hypotenuse, and that's how we'll measure its length.

The magnitude (or length) of a vector $\vec{v}$, written $\|\vec{v}\|$, is the length of any directed line segment that represents it.

In the animation, $(5, 4)$ was the hypotenuse of a triangle with legs $5$ and $4$. Pythagoras does the rest.

The magnitude of $\vec{v} = (v_1, v_2)$ is $$\|\vec{v}\| = \sqrt{v_1^2 + v_2^2}.$$ For the vector from $(a_1, a_2)$ to $(b_1, b_2)$, that's $\sqrt{(b_1 - a_1)^2 + (b_2 - a_2)^2}$.

Show proof

Draw $\vec{v}$ in standard position. Its tip is $(v_1, v_2)$, so the arrow is the hypotenuse of a right triangle with horizontal leg $|v_1|$ and vertical leg $|v_2|$. By the Pythagorean theorem the hypotenuse is $\sqrt{|v_1|^2 + |v_2|^2} = \sqrt{v_1^2 + v_2^2}$. (If one component is $0$, the arrow lies on an axis and its length is the other component's size, which the formula also gives.) $\blacksquare$

One vector deserves a name. The zero vector $\vec{0} = (0, 0)$ is the arrow that starts and ends at the same point. It has length $0$, and it's the only vector that does: $\|\vec{v}\| = 0$ exactly when $\vec{v} = \vec{0}$. It also has no direction at all, which will matter later. Let's do the two main computations.

(a) Find the magnitude of $\vec{v} = (2, 4)$.   (b) Find the component form and the length of the vector from $A(2, -5)$ to $B(-3, 7)$, and graph it.


(a) $\|\vec{v}\| = \sqrt{2^2 + 4^2} = \sqrt{20} = 2\sqrt{5}$.

(b) Terminal minus initial: $(-3 - 2, \, 7 - (-5)) = (-5, 12)$. Its length is $\sqrt{(-5)^2 + 12^2} = \sqrt{169} = 13$. Drawn from $A$, the arrow goes $5$ left and $12$ up.

Your turn. Watch the signs when the initial point has negative coordinates.

Loading practice engine...

And now a length. Simplify the square root all the way.

Loading practice engine...

Scaling, Adding, and Subtracting

There are two basic things you can do with vectors: stretch one, and add two together. First the stretch. In vector-land, a plain real number is called a scalar, because what it does to a vector is scale it.

The scalar multiple of $\vec{v} = (v_1, v_2)$ by a real number $k$ is $$k\vec{v} = k(v_1, v_2) = (kv_1, kv_2).$$

So $2(2, 1) = (4, 2)$ and $-3(2, 1) = (-6, -3)$. Here's what that looks like as $k$ changes:

$k\vec{v}$ is $|k|$ times as long as $\vec{v}$, so $\|k\vec{v}\| = |k| \, \|\vec{v}\|$. A positive $k$ keeps the direction, and a negative $k$ flips it around. That flip has a name: $-\vec{v} = (-1)\vec{v} = (-v_1, -v_2)$ is the negative of $\vec{v}$, same length, opposite direction.

Walking $-\vec{v}$ is just walking $\vec{v}$ backward. I've decided to call it moonwalking and nobody can stop me.

Let $\vec{v} = (1, 2)$. Graph $\vec{v}$, $2\vec{v}$, and $-4\vec{v}$, and find the length of each one.


$2\vec{v} = (2, 4)$ and $-4\vec{v} = (-4, -8)$. Lengths: $\|\vec{v}\| = \sqrt{1 + 4} = \sqrt{5}$, then $\|2\vec{v}\| = 2\sqrt{5}$ and $\|-4\vec{v}\| = |-4|\sqrt{5} = 4\sqrt{5}$. Never negative: a length can't be.

Look at where the three tips landed: all on one straight line through the origin. Every scalar multiple of $\vec{v}$ lives on that line, pointing along it one way or the other. Two vectors on a common line like that get a name.

Two nonzero vectors $\vec{u}$ and $\vec{v}$ are parallel if $\vec{u} = k\vec{v}$ for some real number $k$.

A positive $k$ means they point the same way, a negative $k$ the opposite way. The test in symbols is one division per component, with both components giving the same $k$. In pictures, it's whether one setting of the dial $k$ lands $k\vec{v}$ exactly on $\vec{u}$:

Are these pairs parallel? (a) $(-6, 3)$ and $(2, -1)$   (b) $(2, 4)$ and $(1, 3)$


(a) $\frac{-6}{2} = -3$ and $\frac{3}{-1} = -3$. One scalar for both components: $(-6, 3) = -3(2, -1)$. Parallel, pointing opposite ways.

(b) $\frac{2}{1} = 2$, but $\frac{4}{3}$ isn't $2$. The second component breaks it: not parallel.

Now you work the dial. Slide $k$ and try to land $k\vec{v}$ on each star. One of the stars is a trap:

Stretch and Flip

The trap star is off the line, so no scalar reaches it: it isn't parallel to $\vec{v}$, no matter how close it looks.

Now adding. The rule couldn't be simpler: add matching components.

The sum of $\vec{u} = (u_1, u_2)$ and $\vec{v} = (v_1, v_2)$ is $$\vec{u} + \vec{v} = (u_1 + v_1, \, u_2 + v_2).$$

Geometrically, that means "do one move, then the other." Slide $\vec{v}$ so its tail sits on the tip of $\vec{u}$, without turning it, and the sum runs from the start of $\vec{u}$ to the end of $\vec{v}$:

Either order lands on the same point, and the two routes outline a parallelogram with $\vec{u} + \vec{v}$ as its diagonal. That's why this picture is called the parallelogram law.

(a) $(2, 4) + (-3, 1)$   (b) $(1, 2) + (3, 4)$


(a) $(2 + (-3), \, 4 + 1) = (-1, 5)$.   (b) $(1 + 3, \, 2 + 4) = (4, 6)$.

Subtracting is just adding the negative: flip the second vector around, then add.

The difference of $\vec{u}$ and $\vec{v}$ is $$\vec{u} - \vec{v} = \vec{u} + (-\vec{v}) = (u_1 - v_1, \, u_2 - v_2).$$

Watch it with the notes' favorite pair, $\vec{u} = (2, 4)$ and $\vec{v} = (-1, 3)$. The answer has a second home, too:

$\vec{u} - \vec{v} = (2 - (-1), \, 4 - 3) = (3, 1)$, and it's the arrow from the tip of $\vec{v}$ to the tip of $\vec{u}$. (Check: $\vec{v} + (\vec{u} - \vec{v}) = \vec{u}$, so it has to get you from one tip to the other.) That second picture comes back in the proof at the end of the page.

Okay, so $(6, 3) \div (2, 1)$ is obviously $3$. Then what's $(6, 3) \div (1, 5)$? ...Oh. That's why nobody defines it.

Now string the moves together: scale first, then add.

Let $\vec{u} = (2, 1)$ and $\vec{v} = (1, 5)$. Find (a) $2\vec{u}$   (b) $\vec{u} + \vec{v}$   (c) $3\vec{u} - 2\vec{v}$   (d) Graph $\vec{u}$, $\vec{v}$, $\vec{u} + \vec{v}$, and $-\vec{v}$.


(a) $2\vec{u} = (4, 2)$.   (b) $\vec{u} + \vec{v} = (3, 6)$.

(c) Scale each one, then subtract: $3\vec{u} - 2\vec{v} = (6, 3) - (2, 10) = (4, -7)$.

(d) $\vec{u}$ ends at $(2, 1)$, $\vec{v}$ at $(1, 5)$, $\vec{u} + \vec{v} = (3, 6)$ at $(3, 6)$, and $-\vec{v} = (-1, -5)$ at $(-1, -5)$, all drawn from the origin. The figure draws all four, then walks (c) head to tail: three $\vec{u}$'s, then two $-\vec{v}$'s.

Mixing two vectors with scalars like this, $a\vec{u} + b\vec{v}$, is called a linear combination. Pick the scalars yourself and try to hit the stars:

$a\vec{u} + b\vec{v}$

Here's a different angle on the same addition: grab the vectors themselves.

Head to Tail

That third mission is the big takeaway, and the trap people fall into most.

Lengths don't add. $\|\vec{u} + \vec{v}\|$ equals $\|\vec{u}\| + \|\vec{v}\|$ only when $\vec{u}$ and $\vec{v}$ point the same way; any bend in the path makes the sum shorter. So to find $\|\vec{u} + \vec{v}\|$, add the components first and take the length last.

One more way to see all of it at once. Each purple arrow below is drawn wherever it's most natural, not always from the origin, so you'll need the head-to-tail and tip-to-tip pictures to match it to its expression:

Arrow Algebra

Your turn: scale, then add, component by component.

Loading practice engine...

Points on a Segment

Here's a payoff of thinking in moves. To find the point a third of the way from $A$ to $B$, don't reach for a formula: take a third of the move $\overrightarrow{AB}$ and make it from $A$. Halfway is half the move, three quarters is three quarters of the move, and so on.

Let $A = (a_1, a_2)$ and $B = (b_1, b_2)$ be points and $0 \le t \le 1$. Starting at $A$ and making the move $t\,\overrightarrow{AB}$ lands on the point $$P = \big(a_1 + t(b_1 - a_1), \; a_2 + t(b_2 - a_2)\big),$$ which is $t$ of the way from $A$ to $B$. In particular, the midpoint of the segment is $\left(\frac{a_1 + b_1}{2}, \frac{a_2 + b_2}{2}\right)$.

Show proof

The move from $A$ to $P$ is $t\,\overrightarrow{AB}$, and the move from $P$ to $B$ is what's left: $\overrightarrow{AB} - t\,\overrightarrow{AB} = (1 - t)\overrightarrow{AB}$. Both are nonnegative scalar multiples of $\overrightarrow{AB}$, so both point the same way as $\overrightarrow{AB}$, and laid end to end they make the whole move. So $P$ sits on the segment, with $\|t\,\overrightarrow{AB}\| = t\,\|\overrightarrow{AB}\|$ before it and $(1 - t)\,\|\overrightarrow{AB}\|$ after it: $t$ of the way along. In components, $P = A$ moved by $(t(b_1 - a_1), t(b_2 - a_2))$, which is the formula. At $t = \frac{1}{2}$, $a_1 + \frac{1}{2}(b_1 - a_1) = \frac{a_1 + b_1}{2}$, and the same for the second coordinate. $\blacksquare$

The midpoint is the friendliest case, average the coordinates, and you've probably met it before. The general case is the same move-from-$A$ idea. Here are all three kinds of question at once:

Let $A = (1, 2)$ and $B = (7, -4)$. Find (a) the midpoint of the segment   (b) the point $\frac{1}{3}$ of the way from $A$ to $B$   (c) the point $B'$ that makes $A$ the midpoint of the segment from $B$ to $B'$.


(a) $\left(\frac{1 + 7}{2}, \frac{2 + (-4)}{2}\right) = (4, -1)$.

(b) The move is $\overrightarrow{AB} = (6, -6)$, a third of it is $(2, -2)$, so the point is $(1 + 2, \, 2 - 2) = (3, 0)$.

(c) $A$ is halfway from $B$ to $B'$, so the move from $A$ to $B'$ is the same as the move from $B$ to $A$, which is $\overrightarrow{BA} = (-6, 6)$. So $B' = (1 - 6, \, 2 + 6) = (-5, 8)$.

Now run it the other way. Drag the endpoints until the points that split the segment into thirds land on the stars:

Trisect It

The last mission runs the theorem backward: you know where the thirds have to be, and you're solving for the ends. Like part (c), it's the same move, made one more time.

Unit Vectors

Sometimes all you care about is the direction. Then you want a vector whose length is exactly $1$, so it carries nothing but direction.

A vector $\vec{v}$ with $\|\vec{v}\| = 1$ is called a unit vector.

For example, $(1, 0)$, $(0, 1)$, $\left(\frac{1}{2}, \frac{\sqrt{3}}{2} \right)$, and $\left(-\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2} \right)$ are all unit vectors: square the components, add, and you get $1$. (Try writing down four of your own. Any point on the unit circle works.) Given any vector, there's a quick way to make one.

If $\vec{v}$ is a nonzero vector, then $$\vec{u} = \frac{\vec{v}}{\|\vec{v}\|} = \frac{1}{\|\vec{v}\|}\vec{v}$$ is a unit vector with the same direction as $\vec{v}$.

Show proof

$\vec{u}$ is the scalar multiple of $\vec{v}$ by $k = \frac{1}{\|\vec{v}\|}$, which is positive (since $\vec{v} \ne \vec{0}$), so $\vec{u}$ has the same direction as $\vec{v}$. Its length is $\|k\vec{v}\| = |k| \, \|\vec{v}\| = \frac{1}{\|\vec{v}\|} \cdot \|\vec{v}\| = 1$. $\blacksquare$

Dividing by the length shrinks long vectors and stretches short ones until every one of them lands on the unit circle:

Two by hand. The second one has a whole-number length, which makes life easy; the first doesn't.

Find a unit vector in the direction of (a) $\vec{u} = (2, 1)$   (b) $\vec{v} = (4, 3)$.


(a) $\|\vec{u}\| = \sqrt{4 + 1} = \sqrt{5}$, so the unit vector is $\frac{1}{\sqrt{5}}(2, 1) = \left(\frac{2}{\sqrt{5}}, \frac{1}{\sqrt{5}} \right) = \left(\frac{2\sqrt{5}}{5}, \frac{\sqrt{5}}{5} \right)$ after rationalizing.

(b) $\|\vec{v}\| = \sqrt{16 + 9} = 5$, so the unit vector is $\left(\frac{4}{5}, \frac{3}{5} \right)$. Check: $\frac{16}{25} + \frac{9}{25} = 1$.

Two unit vectors get special names, because every other vector is built out of them.

The standard unit vectors are $\vec{\imath} = (1, 0)$ and $\vec{\jmath} = (0, 1)$.

Any vector splits into a horizontal piece and a vertical piece: $(v_1, v_2) = v_1(1, 0) + v_2(0, 1) = v_1\vec{\imath} + v_2\vec{\jmath}$. That's a linear combination of $\vec{\imath}$ and $\vec{\jmath}$, and the scalars $v_1$ and $v_2$ are called the horizontal and vertical components of $\vec{v}$. Both ways of writing a vector mean exactly the same thing.

(a) Write $\vec{v} = (2, 6)$ in terms of $\vec{\imath}$ and $\vec{\jmath}$.   (b) Do the same for the vector from $(-1, 1)$ to $(2, 2)$, and name its horizontal and vertical components.


(a) $\vec{v} = 2\vec{\imath} + 6\vec{\jmath}$: horizontal component $2$, vertical component $6$.

(b) Terminal minus initial: $(2 - (-1), \, 2 - 1) = (3, 1) = 3\vec{\imath} + \vec{\jmath}$. Horizontal component $3$, vertical component $1$.

Your turn. Some are written with $\vec{\imath}$ and $\vec{\jmath}$, and the harder ones ask for the opposite direction or a different length.

Loading practice engine...

Direction Angles

Component form tells you "how far right, how far up." But a pilot or a sailor would rather hear "how fast, and which way," a length and an angle. Here's the angle.

The direction angle of a nonzero vector $\vec{v}$ is the angle $\theta$, measured counterclockwise from the positive $x$-axis, to $\vec{v}$ drawn in standard position, with $0^\circ \le \theta < 360^\circ$.

A unit vector in standard position has its tip on the unit circle, and the point at angle $\theta$ there is $(\cos\theta, \sin\theta)$. So the unit vector with direction angle $\theta$ is $(\cos\theta, \sin\theta)$.

Every nonzero vector is its length times the unit vector pointing its way, so the unit circle hands us the whole vector.

If $\vec{v}$ has length $\|\vec{v}\|$ and direction angle $\theta$, then $$\vec{v} = \|\vec{v}\|(\cos\theta, \sin\theta) = \|\vec{v}\|\cos\theta \, \vec{\imath} + \|\vec{v}\|\sin\theta \, \vec{\jmath}.$$ Going the other way, the direction angle of $\vec{v} = (v_1, v_2)$ (with $v_1 \ne 0$) satisfies $$\tan\theta = \frac{v_2}{v_1}.$$

Show proof

The unit vector $\frac{\vec{v}}{\|\vec{v}\|}$ points the same way as $\vec{v}$, so it also has direction angle $\theta$, and its tip is on the unit circle at angle $\theta$: $\frac{\vec{v}}{\|\vec{v}\|} = (\cos\theta, \sin\theta)$. Multiply both sides by $\|\vec{v}\|$. Comparing components, $v_1 = \|\vec{v}\|\cos\theta$ and $v_2 = \|\vec{v}\|\sin\theta$, so when $v_1 \ne 0$, $\frac{v_2}{v_1} = \frac{\sin\theta}{\cos\theta} = \tan\theta$. $\blacksquare$

The first formula turns a length and an angle into components.

A vector has length $4$ and direction angle $30^\circ$. Write it in component form.


$\vec{v} = 4(\cos 30^\circ, \sin 30^\circ) = 4\left(\frac{\sqrt{3}}{2}, \frac{1}{2} \right) = (2\sqrt{3}, 2) = 2\sqrt{3}\,\vec{\imath} + 2\vec{\jmath}$.

Your turn. Watch the signs: the quadrant decides which components are negative.

Loading practice engine...

Now backward: components in, angle out. "Easy," you say, "$\theta = \arctan\frac{v_2}{v_1}$." That works when $\theta$ is acute. Otherwise, it's a trap:

$\arctan$ only ever answers between $-90^\circ$ and $90^\circ$, so it can't tell $(-2, 2\sqrt{3})$ from $(2, -2\sqrt{3})$: both have $\tan\theta = -\sqrt{3}$. The fix is the reference angle.

On Angles, the reference angle was the acute angle back to the $x$-axis, with one rule per quadrant. Here $\arctan\left|\frac{v_2}{v_1}\right|$ hands you the reference angle, and the signs of $v_1$ and $v_2$ tell you the quadrant.

So the recipe: find the reference angle from $\left|\frac{v_2}{v_1}\right|$, read the quadrant off the signs, then place the angle.

Find the direction angle of (a) $\vec{u} = 4\vec{\imath} - 4\vec{\jmath}$   (b) $\vec{v} = -3\vec{\imath} + 3\vec{\jmath}$   (c) $\vec{w} = -4\vec{\imath} - 4\sqrt{3}\,\vec{\jmath}$   (d) $\vec{z} = \vec{\imath} - \vec{\jmath}$.


(a) $\left|\frac{-4}{4}\right| = 1$, so the reference angle is $45^\circ$. Right and down is Quadrant IV: $\theta = 360^\circ - 45^\circ = 315^\circ$.

(b) $\left|\frac{3}{-3}\right| = 1$, reference angle $45^\circ$. Left and up is Quadrant II: $\theta = 180^\circ - 45^\circ = 135^\circ$. (A calculator says $\arctan(-1) = -45^\circ$, which points the opposite way.)

(c) $\left|\frac{-4\sqrt{3}}{-4}\right| = \sqrt{3}$, reference angle $60^\circ$. Left and down is Quadrant III: $\theta = 180^\circ + 60^\circ = 240^\circ$.

(d) $\vec{z} = (1, -1)$: reference angle $45^\circ$, Quadrant IV, so $\theta = 315^\circ$, the same as (a). That makes sense, since $\vec{u} = 4\vec{z}$ points the same way as $\vec{z}$.

Drag a vector around and watch the calculator get it wrong:

Direction Angle

Now flip it around: you get only the components, so read the signs and predict before you see the arrow.

Pick the Angle

One with no dial to lean on. Quadrant first, then the reference angle.

Loading practice engine...

The Dot Product

So far, scaling and adding both turn vectors into more vectors. Here's a way to multiply two vectors that gives you back a plain number instead, and that number turns out to know the angle between them.

The dot product of $\vec{u} = (u_1, u_2)$ and $\vec{v} = (v_1, v_2)$ is the number $$\vec{u} \cdot \vec{v} = u_1v_1 + u_2v_2.$$

It's called a product, and it hands me back a plain number. I ordered a vector.

Multiply matching components, then add. That's it. The $\vec{\imath}, \vec{\jmath}$ form works the same way, since $\vec{\imath}$ and $\vec{\jmath}$ just label the components.

Find each dot product: (a) $(2, 6) \cdot (1, 4)$   (b) $(0, -8) \cdot \left(6, \frac{1}{4} \right)$   (c) $(2\vec{\imath} + \vec{\jmath}) \cdot (-\vec{\imath} + 6\vec{\jmath})$   (d) $(5\vec{\imath} - \vec{\jmath}) \cdot 4\vec{\jmath}$   (e) $(5\vec{\imath} - 2\vec{\jmath}) \cdot (4\vec{\imath} + \vec{\jmath})$


(a) $2 \cdot 1 + 6 \cdot 4 = 2 + 24 = 26$.   (b) $0 \cdot 6 + (-8) \cdot \frac{1}{4} = 0 - 2 = -2$.

(c) $(2, 1) \cdot (-1, 6) = -2 + 6 = 4$.   (d) $4\vec{\jmath} = (0, 4)$, so $(5, -1) \cdot (0, 4) = 0 - 4 = -4$.

(e) $(5, -2) \cdot (4, 1) = 5 \cdot 4 + (-2) \cdot 1 = 20 - 2 = 18$.

Drawn, each pair shows something the numbers hide: the positive answers come from arrows less than $90^\circ$ apart, and the negative ones from arrows more than $90^\circ$ apart. The next section explains why.

The dot product follows most of the rules you'd hope a multiplication would.

For vectors $\vec{u}$, $\vec{v}$, $\vec{w}$ in the plane and any real number $k$:

  1. $\vec{u} \cdot \vec{v} = \vec{v} \cdot \vec{u}$
  2. $\vec{u} \cdot \vec{0} = 0$
  3. $\vec{u} \cdot (\vec{v} + \vec{w}) = \vec{u} \cdot \vec{v} + \vec{u} \cdot \vec{w}$
  4. $k(\vec{u} \cdot \vec{v}) = (k\vec{u}) \cdot \vec{v} = \vec{u} \cdot (k\vec{v})$
  5. $\vec{u} \cdot \vec{u} = \|\vec{u}\|^2$
Show proof

Write everything in components. (1) $u_1v_1 + u_2v_2 = v_1u_1 + v_2u_2$, since multiplying numbers doesn't care about order. (2) $u_1 \cdot 0 + u_2 \cdot 0 = 0$. (3) $u_1(v_1 + w_1) + u_2(v_2 + w_2) = (u_1v_1 + u_2v_2) + (u_1w_1 + u_2w_2)$ by distributing. (4) $k(u_1v_1 + u_2v_2) = (ku_1)v_1 + (ku_2)v_2 = u_1(kv_1) + u_2(kv_2)$. (5) $u_1u_1 + u_2u_2 = u_1^2 + u_2^2 = \|\vec{u}\|^2$. $\blacksquare$

That last one is the bridge between dot products and lengths: if $\vec{u} \cdot \vec{u} = 4$, then $\|\vec{u}\| = \sqrt{4} = 2$. Your turn to compute some.

Loading practice engine...

The Angle Between Two Vectors

That sign pattern wasn't a coincidence. Here's the pair that gives it away:

Find the dot product of $\vec{u} = 2\vec{\imath} + \vec{\jmath}$ and $\vec{v} = -3\vec{\imath} + 6\vec{\jmath}$. Graph these vectors. How do you interpret their dot product?


$\vec{u} \cdot \vec{v} = 2 \cdot (-3) + 1 \cdot 6 = -6 + 6 = 0$. Graphed, the two vectors meet at exactly $90^\circ$: $\vec{u}$ goes $2$ right and $1$ up, and $\vec{v}$ is three times "$1$ left and $2$ up," which is $\vec{u}$'s move turned a quarter turn.

A dot product of $0$ and a right angle. That's no accident: the dot product measures how much two vectors point the same way. First, which angle are we even talking about?

The angle between two nonzero vectors $\vec{u}$ and $\vec{v}$ is the angle $\theta$, with $0^\circ \le \theta \le 180^\circ$, between them when both are drawn in standard position.

Always the short way around, so never more than $180^\circ$. (And there's no angle between $\vec{0}$ and anything: the zero vector has no direction.) Now watch the dot product as the angle opens up:

Positive for acute angles, zero at a right angle, negative for obtuse ones. The shadow in that picture hints at the exact relationship, and it's this:

If $\theta$ is the angle between the nonzero vectors $\vec{u}$ and $\vec{v}$, then

$\displaystyle \cos\theta = \frac{\vec{u} \cdot \vec{v}}{\|\vec{u}\| \, \|\vec{v}\|},$that is,$\displaystyle \vec{u} \cdot \vec{v} = \|\vec{u}\| \, \|\vec{v}\| \cos\theta.$
Show proof

Draw $\vec{u}$ and $\vec{v}$ in standard position. The vector $\vec{u} - \vec{v}$ runs from the tip of $\vec{v}$ to the tip of $\vec{u}$, so the three vectors form a triangle with sides $\|\vec{u}\|$, $\|\vec{v}\|$, $\|\vec{u} - \vec{v}\|$ and the angle $\theta$ between the first two. By the Law of Cosines, $$\|\vec{u} - \vec{v}\|^2 = \|\vec{u}\|^2 + \|\vec{v}\|^2 - 2\|\vec{u}\| \, \|\vec{v}\| \cos\theta.$$ Now compute the same thing with the dot product properties: $$\|\vec{u} - \vec{v}\|^2 = (\vec{u} - \vec{v}) \cdot (\vec{u} - \vec{v}) = \vec{u} \cdot \vec{u} - 2\,\vec{u} \cdot \vec{v} + \vec{v} \cdot \vec{v} = \|\vec{u}\|^2 - 2\,\vec{u} \cdot \vec{v} + \|\vec{v}\|^2.$$ The two right sides are equal, so $-2\|\vec{u}\| \, \|\vec{v}\| \cos\theta = -2\,\vec{u} \cdot \vec{v}$, and dividing by $-2\|\vec{u}\| \, \|\vec{v}\|$ (not zero, since both vectors are nonzero) gives the formula. If $\vec{u}$ and $\vec{v}$ point the same way or opposite ways, the "triangle" is flat, but the Law of Cosines still holds with $\theta = 0^\circ$ or $180^\circ$ (it reads $\|\vec{u} - \vec{v}\| = \big|\|\vec{u}\| - \|\vec{v}\|\big|$ or $\|\vec{u}\| + \|\vec{v}\|$), so the formula does too. $\blacksquare$

Here's that proof as a picture, with real numbers:

Since $\|\vec{u}\|$ and $\|\vec{v}\|$ are positive, $\cos\theta$ has the same sign as $\vec{u} \cdot \vec{v}$. That's why the sign told the whole story in the animation before. Sort a few pairs by sign alone:

Sign of $\vec{u} \cdot \vec{v}$

And here's where the shadow comes from: $\|\vec{v}\|\cos\theta$ is exactly the length of $\vec{v}$'s shadow on $\vec{u}$'s line, so $\vec{u} \cdot \vec{v} = \|\vec{u}\| \times \text{(that shadow)}$. Drag $\vec{v}$ and check that the two ways of computing it always agree:

Shadow of $\vec{v}$

To find an angle: compute $\vec{u} \cdot \vec{v}$ and both lengths, divide to get $\cos\theta$, and find $\theta$ between $0^\circ$ and $180^\circ$. If the cosine isn't a unit-circle value, write the answer with $\arccos$.

Find the angle between each pair: (a) $(2\sqrt{3}, 2)$ and $(5, 5\sqrt{3})$   (b) $\sqrt{3}\,\vec{\imath} + \vec{\jmath}$ and $-3\vec{\jmath}$   (c) $(3, 4)$ and $(-3, -4)$


(a) The dot product is $10\sqrt{3} + 10\sqrt{3} = 20\sqrt{3}$, and the lengths are $\sqrt{12 + 4} = 4$ and $\sqrt{25 + 75} = 10$. So $\cos\theta = \frac{20\sqrt{3}}{40} = \frac{\sqrt{3}}{2}$ and $\theta = 30^\circ$. Check: the first vector has direction angle $30^\circ$ and the second $60^\circ$.

(b) $(\sqrt{3}, 1) \cdot (0, -3) = -3$, with lengths $2$ and $3$, so $\cos\theta = \frac{-3}{6} = -\frac{1}{2}$ and $\theta = 120^\circ$. Check: $30^\circ$ up to the first vector, $90^\circ$ down to the second.

(c) $-9 - 16 = -25$, lengths $5$ and $5$, so $\cos\theta = -1$ and $\theta = 180^\circ$. They point in exactly opposite directions.

Not every cosine lands on the unit circle. Then the answer stays in $\arccos$ form.

Find the angle between (a) $(0, 3)$ and $(-\sqrt{3}, 1)$   (b) $(2, 0)$ and $(-1, 3)$   (c) $(2, -1)$ and $(1, 2)$.


(a) Dot product $0 + 3 = 3$, lengths $3$ and $2$: $\cos\theta = \frac{1}{2}$, so $\theta = 60^\circ$.

(b) Dot product $-2$, lengths $2$ and $\sqrt{10}$: $\cos\theta = \frac{-2}{2\sqrt{10}} = -\frac{1}{\sqrt{10}} = -\frac{\sqrt{10}}{10}$. That's not a unit-circle value, so $\theta = \arccos\left(-\frac{\sqrt{10}}{10}\right) \approx 108.43^\circ$.

(c) Dot product $2 - 2 = 0$, so $\cos\theta = 0$ and $\theta = 90^\circ$.

Your turn. Some pairs come from the unit circle, some are plain whole numbers.

Loading practice engine...

Orthogonal Vectors

A dot product of zero means a right angle, and right angles come up so often that this gets its own word.

Two vectors $\vec{u}$ and $\vec{v}$ are orthogonal if $\vec{u} \cdot \vec{v} = 0$.

For example, $\vec{\imath} \cdot \vec{\jmath} = 1 \cdot 0 + 0 \cdot 1 = 0$, and sure enough, $\vec{\imath}$ and $\vec{\jmath}$ meet at $90^\circ$. For nonzero vectors, orthogonal is just a fancy word for perpendicular. But the definition says any two vectors, which lets one weird case in.

The zero vector is orthogonal to every vector, since $\vec{u} \cdot \vec{0} = 0$ always, even though there's no angle between $\vec{0}$ and anything. So "orthogonal" and "perpendicular" agree for nonzero vectors only. And a quick way to build an orthogonal vector: swap the components and change one sign. $(a, b) \cdot (-b, a) = -ab + ab = 0$.

The zero vector is orthogonal to everybody and points nowhere. Total chaos agent.

So checking orthogonality is one dot product. The picture is still worth a look, because it shows how close "not orthogonal" can be:

Are these pairs orthogonal? (a) $4\vec{\imath} - 6\vec{\jmath}$ and $3\vec{\imath} + 2\vec{\jmath}$   (b) $(2, -3)$ and $(6, 4)$   (c) $2\vec{\imath} + \vec{\jmath}$ and $\vec{\imath} - 3\vec{\jmath}$


(a) $4 \cdot 3 + (-6) \cdot 2 = 12 - 12 = 0$. Yes.   (b) $12 - 12 = 0$. Yes.

(c) $2 \cdot 1 + 1 \cdot (-3) = 2 - 3 = -1$. No: the angle between them is a little more than $90^\circ$.

Your turn. The free-response version takes any vector that works, and there are infinitely many.

Loading practice engine...

Run it backwards: when a vector has an unknown in it, set the dot product to zero and solve.

Find the value(s) of $n$ so that $\vec{u} = (-1, n + 1)$ and $\vec{v} = (6, n)$ are orthogonal.


Set $\vec{u} \cdot \vec{v} = 0$: $(-1)(6) + (n + 1)n = 0$, so $n^2 + n - 6 = 0$. That factors as $(n + 3)(n - 2) = 0$, so $n = -3$ or $n = 2$. Two answers. Check $n = 2$: $(-1, 3) \cdot (6, 2) = -6 + 6 = 0$.

Why two? Slide $n$ and both vectors swing around. Their dot product, $n^2 + n - 6$, is a parabola in $n$, and it crosses zero twice:

Now you. Some of these have one answer, some have two: find them all.

Loading practice engine...

Linear algebra's Vectors page makes these same moves in space, with a third component. Later, in Inner Products, the dot product grows up: it works in any number of dimensions, and it gets a new name and a new outfit, $(x, y)$, the inner product. (Linear algebra also drops the arrows on vectors and writes plain letters.)

That's the whole toolkit: vectors as moves, components and length, scaling and adding, parallel vectors and points along a segment, unit vectors, direction angles, and the dot product with the angles it measures. Before you go, some practice without the hints.

Mixed Practice

Every question so far came right after its idea, which is a hint a quiz never gives you. Down here the hint is gone. First, true or false: a claim about vectors from anywhere on this page, and you decide whether it holds.

Loading practice engine...

Next, a mixed set: every question type on this page, shuffled. Figuring out which idea a question needs is half the work.

Loading practice engine...

Made it this far? Time for something with a little heat. These chain the whole page together: two forces or a plane in the wind, given by lengths and angles, and you find the length of the total, or work backward to the angle. Hint: $\|\vec{u} + \vec{v}\|^2 = (\vec{u} + \vec{v}) \cdot (\vec{u} + \vec{v})$.

🌶️ SPICY BONUS 🌶️

Loading practice engine...