Calculating the Dot Product and the Angle

Working out a dot product from components, why the answer is a scalar rather than a vector, and rearranging the formula to recover the angle between two vectors - including the perpendicular case where the result is zero.

--

The dot product turns two vectors into a single number. That number, combined with the two lengths, is enough to recover the exact angle between them.

Theorem How to compute it

Multiply the x-components together, multiply the y-components together, then add.

The answer is a scalar, not a vector. This is the key difference from the cross product, which returns a vector.

Example Two dot products
x-parts:
y-parts:
⟹ 63
⟹ 5

Negative components are handled exactly as they look — , which then gets added.

Theorem The angle formula
θ A B
Divide the dot product by the product of the two lengths, then take the inverse cosine.
where .
Example Finding the angle

Find the angle between and .

Step 1 — the dot product:
Step 2 — the length of A:
Step 3 — the length of B:
Step 4 — apply the formula:
Step 5 — take the inverse cosine.
⟹ θ ≈ 14.3°

A small angle makes sense: the cosine came out close to 1, meaning the vectors nearly point the same way.

Note Two shortcuts worth knowing
, so and θ = 90°.
⟹ a dot product of zero means the vectors are perpendicular
, with lengths 5 and 10, giving .
⟹ θ = 0°, the vectors are parallel

Checking for a zero dot product is the quickest test for perpendicularity there is.

Summary
  1. A · B = a₁b₁ + a₂b₂, and the answer is always a number.
  2. ⟨3, 4⟩ · ⟨5, 12⟩ = 63.
  3. cos θ = (A · B) / (|A| |B|), then take the inverse cosine.
  4. For those vectors cos θ = 63/65, giving θ ≈ 14.3°.
  5. A dot product of 0 means perpendicular; cos θ = 1 means parallel.