Vectors
The Dot Product and the Angle Between Vectors
A product of two vectors that returns a number, why it equals |u||v|cos θ, and the test for perpendicularity.
What this page covers
- Compute a dot product from components
- State and use the geometric form of the dot product
- Find the angle between two vectors
- Test two vectors for perpendicularity
The definition
Multiply matching components and add. The source emphasises that the answer is a scalar, not a vector, which is why it is also called the scalar product.
A first computation
For u = (2, 3) and v = (5, -7):
Negative, which will turn out to mean the angle between them is obtuse.
The geometric form
If two vectors are inclined at angle θ, then
The source derives it from the cosine rule, applied to the triangle whose sides are u, v and u - v.
The derivation
By the cosine rule on that triangle:
Now expand the left side in components:
Comparing the two expressions, the squared-magnitude terms cancel and what remains is
So the algebraic definition and the geometric one agree. That equivalence is what makes the dot product useful: the components are easy to compute with, and the angle is what is usually wanted.
Finding the angle
Worked example — the source's case
Find the angle between u = (2, 3) and v = (5, -7).
Week 10, page 5 has an intermediate line reading -11 = √74cos θ, which has dropped the factor |u| = √13. The final numeric answer is right, and the check at the foot of the same page restores the factor, writing cos θ = u · v|u||v| and obtaining -0.3547. Only the intermediate line is wrong.
The dot product is negative, so the angle must exceed 90°. 110.8° does ✓.
What the sign tells you
| u · v | cos θ | Angle | Meaning |
|---|---|---|---|
| Positive | Positive | 0° ≤ θ < 90° | The vectors broadly agree in direction |
| Zero | Zero | θ = 90° | Perpendicular |
| Negative | Negative | 90° < θ ≤ 180° | The vectors broadly oppose |
| |u||v| | 1 | θ = 0° | Parallel, same direction |
| -|u||v| | -1 | θ = 180° | Parallel, opposite direction |
Two non-zero vectors are perpendicular exactly when u · v = 0.
This is a far cheaper test than computing an angle. For u = (3, 2) and v = (-2, 3): -6 + 6 = 0, so they are perpendicular, with no inverse trigonometry required.
The same fact appeared earlier in a different guise. Two lines are perpendicular when m1m2 = -1; direction vectors (q, p) and (-p, q) have slopes pq and -qp, and their dot product is -qp + pq = 0. The two conditions are the same statement.
Properties
| Property | Statement | Note |
|---|---|---|
| Commutative | u · v = v · u | Unlike matrix multiplication |
| Distributive | u · (v + w) = u · v + u · w | Over vector addition |
| Scalar | (cu) · v = c(u · v) | Scalars pass through |
| Self | u · u = |u|2 | Since cos 0 = 1 |
| Zero | 0 · v = 0 | For every v |
The fourth is worth noting: taking the dot product of a vector with itself gives the square of its magnitude, which provides an alternative route to |u| and is used constantly in proofs.
From u · v = u · w it does not follow that v = w. Rearranging gives u · (v - w) = 0, which only says u is perpendicular to v - w. Any w differing from v by a vector perpendicular to u will satisfy the equation.
Common mistakes
| Mistake | Correct | Check |
|---|---|---|
| Expecting a vector result | The dot product is a scalar | The components are multiplied then added |
| Dropping a magnitude from the denominator | Divide by |u||v| | |cos θ| must not exceed 1 |
| cos θ coming out beyond [-1, 1] | An arithmetic error has occurred | Recompute the magnitudes |
| Concluding v = w from u · v = u · w | No cancellation law | u is perpendicular to v - w |
| Forgetting the sign check | A negative dot product means an obtuse angle | Compare with the computed angle |
| Testing perpendicularity by computing the angle | Just check whether the dot product is zero | Faster and exact |
Frequently asked questions
Why is the result a scalar?
Because the components are multiplied and then added, and adding numbers gives a number. That is why it is also called the scalar product.
What does the dot product measure?
How much the two vectors point the same way. It is positive when the angle is acute, zero when they are perpendicular, and negative when the angle is obtuse.
How do I test for perpendicularity?
Check whether the dot product is zero. u · v = 0 with neither vector zero means cos θ = 0, hence θ = 90°.
Does it work in three dimensions?
Yes. u · v = u1v1 + u2v2 + u3v3, and the geometric formula is unchanged. The derivation from the cosine rule carries over directly.
Source. Handwritten teaching notes, Week 10, pages 3-6.
This page is an original exposition prepared for the KEVOS® knowledge library. It restates, reorganises and verifies the mathematics of the supplied teaching notes; it is not a reproduction of them. Numerical values taken from the notes are identified as source examples and are not presented as engineering standards.
