Suppose you have two arrows drawn from the same point. One question is unavoidable in geometry, physics, and mechanics: what is the angle between them? You could measure it with a protractor on paper, but that fails the moment the vectors live in 3D. The dot product gives you the angle by pure calculation.
The Core Idea
The scalar (dot) product of two vectors has two faces that describe the same number:
a⋅b=a1b1+a2b2+a3b3(components)
a⋅b=∣a∣∣b∣cosθ(geometry)
The first is easy to compute from coordinates; the second hides the angle θ (with 0≤θ≤π) between the vectors. Setting them equal and solving for cosθ gives the master formula.
cosθ=∣a∣∣b∣a⋅b,θ=cos−1(∣a∣∣b∣a⋅b)
Why It Works
Both vectors have a fixed length, so the only thing the dot product can "vary" with is how aligned they are. When they point the same way, cosθ=1 and the dot product is as large as possible, ∣a∣∣b∣. When they are perpendicular, cosθ=0 and the dot product vanishes. When they point opposite ways, cosθ=−1. Dividing a⋅b by the two lengths simply strips away the size information and leaves behind a pure measure of alignment — exactly cosθ.
Note
The sign of the dot product tells you the type of angle at a glance: positive ⇒ acute, zero ⇒ right angle, negative ⇒ obtuse.