Ⅴ Vectors, Space & Complex Numbers · Stage 27 — Plane Vectors · 27.4 The Dot ProductAll lessons →
Stage 27 · Plane Vectors

The Dot Product

Multiply two vectors into one number that knows the angle between them.

Ages 14–18 · Reasoning, one step at a time
The signature picture of this lesson. Two vectors a = (4, 1) and b = (1, 3) share a tail; the angle θ they open is 57.5°. The dashed slate drop carries the head of b straight down onto the line of a, leaving b's shadow (its projection). The dot product a·b = 4·1 + 1·3 = 7 is one number that packs both lengths and that angle: a·b = |a||b|cos θ.

You already know how to add two vectors and how to scale one (27.2), and you can turn any vector into a pair of numbers a = (x, y) (27.3). But there is no honest way to "multiply" two arrows and get a third arrow. So we do something better. We multiply two vectors into a single number — the dot product a·b — and that one number quietly remembers both lengths and the angle between the arrows. Its sign alone tells you whether the two point roughly the same way (acute), straight across (right angle), or roughly opposite (obtuse). And the cleanest test in all of geometry falls right out: two vectors are perpendicular exactly when their dot product is zero. Let's build it from a shadow.

27.4.1 The angle between two vectors, and a shadow

Slide the tails of a and b together so they start at the same point. The two arrows open up an angle. We always measure the smaller way around, so the angle between vectors is some θ with 0° ≤ θ ≤ 180° — never negative, never more than a straight angle. When the arrows point the same way, θ = 0°; when they point straight apart, θ = 180°; a right angle is θ = 90°.

Now stand a flashlight directly "above" the line of a and let b cast a shadow straight down onto that line. The length of that shadow (with a sign: positive if it falls along a, negative if it falls the opposite way) is the projection of b onto a. In a right triangle the adjacent side is hypotenuse × cos, so the shadow has signed length |b| cos θ. The shadow is the bridge between "angle" and "number."

The angle θ between a = (4, 0) and b = (2, 3), and the green shadow that b casts on the line of a. The dashed slate drop meets a at a right angle, so the shadow's length is |b| cos θ. Here θ ≈ 56.3° and the shadow runs 2 units along a.
Key idea

The angle between a and b is θ ∈ [0°, 180°]. The signed shadow of b on a has length |b| cos θ — positive when θ is acute, zero when θ = 90°, negative when θ is obtuse.

27.4.2 Defining the dot product

Here is the definition. The dot product of a and b is

a·b = |a| |b| cos θ.

Read it slowly. It is the length of a, times the length of b, times the cosine of the angle between them — three ordinary numbers multiplied together. So a·b is a number, a plain scalar, not an arrow. The middle "·" is a brand-new operation: it is not the cross multiplication of arithmetic, and it is not the cross product. It eats two vectors and returns one number.

Why this combination? Group it as |a| × (|b| cos θ): the length of a times the signed shadow of b on a from §27.4.1. The dot product measures how much of b lies along a, scaled by how long a is — a clean measure of how "in sync" the two arrows are.

Example

Let |a| = 3, |b| = 4, and θ = 60°. Then a·b = 3 · 4 · cos 60° = 12 · 12 = 6. If instead θ = 120°, then cos 120° = −12, so a·b = 12 · (−12) = −6. Same lengths, opposite sign — because the arrows now lean apart.

27.4.3 What the sign means: acute, right, obtuse

The two lengths |a| and |b| are never negative, so in a·b = |a||b|cos θ the sign of the dot product is the sign of cos θ. And cos θ marches steadily down from +1 to −1 as θ goes from 0° to 180°, crossing 0 exactly at θ = 90°. That gives a beautiful three-way reading you can do without any pictures:

a·bcos θthe angle θthe arrows
> 0> 00° ≤ θ < 90° — acutelean the same way
= 0= 0θ = 90° — right angleperpendicular ⊥
< 0< 090° < θ ≤ 180° — obtuselean apart

So a single number — even its sign — already tells you the rough geometry. Positive: friendly, pointing alike. Zero: square. Negative: opposed. Keep this table; it is the spine of the whole lesson.

Try it The dot-product driver — watch the sign track the angle
Vector a = (4, 1) is fixed. Dial the head of b and watch θ, the green shadow, and the sign of a·b move together.
bx 1
by 3

27.4.4 The dot product in coordinates

The definition |a||b|cos θ is geometric, but you rarely know θ up front. The miracle of coordinates is that you do not need it. Write a = (x₁, y₁) and b = (x₂, y₂). Then

a·b = x₁x₂ + y₁y₂.

Just multiply matching components and add. No angle, no cosine — only the four coordinates. (This comes straight from the law of cosines applied to the triangle on a, b, and a − b; we prove exactly that in 27.5.) The two formulas must agree, and they always do.

Example

With a = (4, 1) and b = (1, 3): a·b = 4·1 + 1·3 = 4 + 3 = 7. Let's double-check geometrically: |a| = √(4²+1²) = √17 ≈ 4.12, |b| = √(1²+3²) = √10 ≈ 3.16, and θ ≈ 57.5°, so |a||b|cos θ ≈ 4.12 · 3.16 · 0.537 ≈ 7. The two routes meet — exactly as they must.

27.4.5 Length and angle from the dot product

Dot a vector with itself. The angle from a to a is 0°, and cos 0° = 1, so a·a = |a||a|·1 = |a|². In coordinates, a·a = x₁² + y₁² — the Pythagorean sum. Either way:

a·a = |a|², so |a| = √(a·a) = √(x₁² + y₁²).

And running the definition backward recovers the angle from coordinates alone. Since a·b = |a||b|cos θ,

cos θ = a·b|a| |b| = x₁x₂ + y₁y₂√(x₁²+y₁²) · √(x₂²+y₂²).

Hand a figure to coordinates and every length and every angle becomes arithmetic. That is the engine behind the next lesson's proofs.

Example

Find the angle between a = (3, 0) and b = (1, 1). Then a·b = 3·1 + 0·1 = 3, |a| = 3, |b| = √2, so cos θ = 3 / (3·√2) = 1/√2 ≈ 0.707, giving θ = 45°. Exactly the slope-1 diagonal — the picture agrees.

27.4.6 The perpendicularity test: a·b = 0

Set θ = 90° in the definition. Because cos 90° = 0, the dot product collapses to a·b = |a||b|·0 = 0. And the reverse holds too: if a·b = 0 with neither vector the zero vector, then cos θ = 0, forcing θ = 90°. So we get the cleanest right-angle test in mathematics:

aba·b = 0 ⇔ x₁x₂ + y₁y₂ = 0.

No protractor, no slopes to compare, no special cases for vertical lines. Just multiply, add, and check for zero. For example, (3, 2) and (2, −3) are perpendicular because 3·2 + 2·(−3) = 6 − 6 = 0. (Notice the trick: swapping coordinates and negating one always makes a perpendicular — that is exactly v = (−y, x).)

Try it Perpendicularity hunt — drive a·b to zero
Vector a = (3, 2) is fixed. Tune b until a·b reads exactly 0 — the figure snaps a right-angle mark and the readout turns green. (Try b = (2, −3) or b = (−2, 3).)
bx 2
by 2

27.4.7 The rules — and one thing you may not do

The dot product obeys the algebra you'd hope for. It is commutative (order doesn't matter), it distributes over addition, and scalars pull out:

rulestatement
commutativea·b = b·a
distributivea·(b + c) = a·b + a·c
scalar pulls outab = λ(a·b)
self-dota·a = |a|² ≥ 0

These let you expand brackets exactly as in ordinary algebra — for instance (a + b)·(a + b) = a·a + 2 a·b + b·b = |a|² + 2 a·b + |b|², which is how a single line proves the law of cosines next lesson.

Watch out

a·b is a number, not a vector — never draw an arrow for it. There is no division by a vector, and you may not "cancel": a·b = a·c does not force b = c (it only says a is perpendicular to b − c). The grouping "(a·b)c" and "a(b·c)" are different vectors — the dot product is not associative across a third vector, because a·b is already a scalar. And |a·b| = |a||b| only when ab (so cos θ = ±1); in general |a·b| = |a||b||cos θ| is smaller.

What to carry forward

ideathe formula
dot product (geometry)a·b = |a| |b| cos θ — a number
dot product (coordinates)a·b = x₁x₂ + y₁y₂
sign ↔ angle> 0 acute · = 0 right · < 0 obtuse
length|a| = √(a·a) = √(x₁²+y₁²)
anglecos θ = (a·b) / (|a| |b|)
perpendicular testaba·b = 0

Six lines that turn every question about angles, lengths, and right angles into a multiply-and-add. Next, in 27.5, we let the dot product loose as a proof engine — perpendicular becomes "make the dot zero," and the law of cosines drops out in two lines.

Exercises

  1. Compute a·b in coordinates for a = (5, −2) and b = (3, 4). Is the angle acute, right, or obtuse?
    Answer

    a·b = 5·3 + (−2)·4 = 15 − 8 = 7. Since 7 > 0, the angle is acute — the arrows lean the same general way.

  2. For a = (2, 6), find a vector b ≠ 0 with ab. How many such directions are there?
    Answer

    Need 2·x + 6·y = 0, i.e. x = −3y. Take y = 1 ⇒ x = −3, so b = (−3, 1) works: 2·(−3) + 6·1 = −6 + 6 = 0. Every perpendicular is a scalar multiple of (−3, 1) (or its opposite (3, −1)), so there is exactly one direction (a single line through the origin), traced in two opposite ways.

  3. Find the angle θ between a = (1, √3) and b = (√3, 1). (Both have length 2.)
    Answer

    a·b = 1·√3 + √3·1 = 2√3. |a| = √(1+3) = 2 and |b| = 2, so cos θ = 2√3 / (2·2) = √3/2 ≈ 0.866. Therefore θ = 30°. (Indeed (1, √3) points at 60° and (√3, 1) at 30°, and 60° − 30° = 30°.)

  4. Given |a| = 5, |b| = 2, and a·b = −6, find cos θ and decide acute / right / obtuse.
    Answer

    cos θ = (a·b)/(|a||b|) = −6 / (5·2) = −6/10 = −0.6. Since cos θ < 0, θ is between 90° and 180°: the angle is obtuse (θ ≈ 126.9°).

  5. Use a·a = |a|² to find |a| for a = (−6, 8). Then find the unit vector in a's direction.
    Answer

    a·a = (−6)² + 8² = 36 + 64 = 100, so |a| = √100 = 10. The unit vector is a/|a| = (−6/10, 8/10) = (−0.6, 0.8); check (−0.6)² + 0.8² = 0.36 + 0.64 = 1. ✓

  6. True or false: if a·b = a·c, then b = c. Explain with a counterexample.
    Answer

    False. a·b = a·c only says a·(b − c) = 0, i.e. a ⊥ (b − c). Example: a = (1, 0), b = (3, 5), c = (3, −2). Then a·b = 3 and a·c = 3 are equal, yet b ≠ c. You may never cancel a vector from a dot product.

🎯 Quick check

Six questions to lock it in. Tap the answer you think is right.

§ For teachers and parents

This lesson develops the dot product as both a geometric quantity (a·b = |a||b|cos θ) and a coordinate computation (a·b = x₁x₂ + y₁y₂), aligning with the Common Core vector standards HSN-VM.A (represent and interpret vectors) and HSN-VM.B (perform operations on vectors), and reaching toward HSN-VM.C applications. The sign-of-the-dot reading of the angle and the perpendicularity test a·b = 0 set up coordinate proofs of the laws of cosines and sines (Stage 25) and the geometry/physics work of the next lesson. Encourage learners to verify both formulas for the dot product agree on every example — the agreement is the whole point. Every figure here is computed from the vector helpers, so the picture and the readout can never disagree.

eastmath.com · Stage 27 · 27.4 The Dot Product · Reasoning, one step at a time