The dot product
What you'll learn
Measure how much two vectors agree — and read angle, projection, and perpendicularity from one number.
How much do two vectors agree? One points mostly east, the other east-north-east — are they allies, strangers, or opponents? The dot product answers with a single number.
Two formulas, one number
The dot product of u = (u₁, u₂) and v = (v₁, v₂) can be computed two ways — and the fact that they always match is the useful part:
The first face is arithmetic you can do in your head. The second says what that arithmetic means: it measures the angle θ between the vectors.
The shadow picture
Project u onto v's direction — cast its shadow. The shadow's length is |u| cos θ, so the dot product is shadow × |v|: how much of u lies along v, weighted by how long v is.
The sign is a verdict
| u · v | Angle | Meaning |
|---|---|---|
| positive | less than 90° | pointing broadly the same way |
| zero | exactly 90° | perpendicular — no overlap at all |
| negative | more than 90° | pointing broadly against each other |
The zero case gets a name — orthogonal — and it's the most important of the three. Checking perpendicularity now costs one multiplication and one addition: (3, 2) · (−2, 3) = −6 + 6 = 0. No angles, no trig.
Where you've already seen it
Work in physics is a dot product: W = F · d — only the force component along the motion counts, which is exactly what the shadow computes. A similarity score between two data profiles is a dot product. So is every pixel of every neural-network layer. It's the workhorse product of applied math.
Why this matters
Angles, lengths, perpendicularity — the dot product turns all the geometry of the plane into arithmetic. Next: leaving the page entirely, into the third dimension.
Check your understanding
Question 1 of 2
u · v = 0 for two nonzero vectors. What do you know?