STEMviz
Mathematics · Geometry, Vectors and Statistics

The Scalar (Dot) Product and the Angle Between Vectors

The scalar (dot) product: its geometric and component definitions, the perpendicularity test, its algebraic properties, and finding angles and projections.

The Scalar (Dot) Product and the Angle Between Vectors

The scalar product is the first way of multiplying two vectors together, and it is the single most useful tool this block introduces: it converts a question about an angle into a question about components, and vice versa. Everything in the rest of this block that involves "find the angle between..." or "show that these are perpendicular" reduces, eventually, to a scalar product.

To follow the chapter you need components, magnitude and the properties of vector addition and scalar multiplication from the previous two chapters, plus the cosine rule from basic trigonometry. Have both ready, since the scalar product is defined twice — once geometrically, once algebraically — and the cosine rule is what connects the two definitions.

Two definitions, one quantity. The scalar (or dot) product of two vectors can be computed either from their components or from their magnitudes and the angle between them. The content of this chapter is proving these two routes always agree.

1. The Geometric Definition

For two non-zero vectors u⃗\vec u and v⃗\vec v drawn from a common point, with angle θ\theta between them (0°≤θ≤180°0°\le\theta\le180°), the scalar product is defined as

u⃗⋅v⃗=∣u⃗∣∣v⃗∣cos⁡θ\vec u \cdot \vec v = |\vec u||\vec v|\cos\theta

The result is a scalar (a number), not a vector — hence the name. Notice immediately that u⃗⋅v⃗\vec u\cdot\vec v is positive when θ\theta is acute, negative when θ\theta is obtuse, and exactly zero when θ=90°\theta=90°, since cos⁡90°=0\cos90°=0.

Perpendicularity test. Two non-zero vectors u⃗\vec u and v⃗\vec v are perpendicular if and only if u⃗⋅v⃗=0\vec u\cdot\vec v = 0. This single fact is used constantly throughout the rest of this block.

2. The Component (Algebraic) Formula

In component form, for u⃗=(u1u2u3)\vec u=\begin{pmatrix}u_1\\u_2\\u_3\end{pmatrix} and v⃗=(v1v2v3)\vec v=\begin{pmatrix}v_1\\v_2\\v_3\end{pmatrix},

u⃗⋅v⃗=u1v1+u2v2+u3v3\vec u\cdot\vec v = u_1v_1+u_2v_2+u_3v_3

(drop the third term in 2D). To see that this must agree with the geometric definition, apply the cosine rule to the triangle formed by u⃗\vec u, v⃗\vec v and u⃗−v⃗\vec u-\vec v (drawn from the same point, so u⃗−v⃗\vec u - \vec v is the third side):

∣u⃗−v⃗∣2=∣u⃗∣2+∣v⃗∣2−2∣u⃗∣∣v⃗∣cos⁡θ|\vec u-\vec v|^2 = |\vec u|^2+|\vec v|^2-2|\vec u||\vec v|\cos\theta

Expanding the left side using components, ∣u⃗−v⃗∣2=(u1−v1)2+(u2−v2)2+(u3−v3)2=∣u⃗∣2+∣v⃗∣2−2(u1v1+u2v2+u3v3)|\vec u-\vec v|^2=(u_1-v_1)^2+(u_2-v_2)^2+(u_3-v_3)^2 = |\vec u|^2+|\vec v|^2 - 2(u_1v_1+u_2v_2+u_3v_3). Comparing the two expressions for ∣u⃗−v⃗∣2|\vec u-\vec v|^2 forces

∣u⃗∣∣v⃗∣cos⁡θ=u1v1+u2v2+u3v3|\vec u||\vec v|\cos\theta = u_1v_1+u_2v_2+u_3v_3

which is exactly u⃗⋅v⃗\vec u\cdot\vec v by the geometric definition — the two formulas for the scalar product are proven identical.

Worked example. Find u⃗⋅v⃗\vec u\cdot\vec v for u⃗=(3−21)\vec u=\begin{pmatrix}3\\-2\\1\end{pmatrix}, v⃗=(45−2)\vec v=\begin{pmatrix}4\\5\\-2\end{pmatrix}.

u⃗⋅v⃗=(3)(4)+(−2)(5)+(1)(−2)=12−10−2=0\vec u\cdot\vec v = (3)(4)+(-2)(5)+(1)(-2) = 12-10-2 = 0

Since the scalar product is zero, u⃗\vec u and v⃗\vec v are perpendicular.

3. Properties of the Scalar Product

From the component formula, the scalar product inherits ordinary algebraic properties:

u⃗⋅v⃗=v⃗⋅u⃗(commutative)\vec u\cdot\vec v = \vec v\cdot\vec u \qquad \text{(commutative)} u⃗⋅(v⃗+w⃗)=u⃗⋅v⃗+u⃗⋅w⃗(distributive)\vec u\cdot(\vec v+\vec w) = \vec u\cdot\vec v + \vec u\cdot\vec w \qquad \text{(distributive)} (ku⃗)⋅v⃗=k(u⃗⋅v⃗)(scalar factors out)(k\vec u)\cdot\vec v = k(\vec u\cdot\vec v) \qquad \text{(scalar factors out)} v⃗⋅v⃗=∣v⃗∣2(self dot product gives magnitude squared)\vec v\cdot\vec v = |\vec v|^2 \qquad \text{(self dot product gives magnitude squared)}

The last identity follows by setting u⃗=v⃗\vec u=\vec v in the component formula: v12+v22+v32=∣v⃗∣2v_1^2+v_2^2+v_3^2 = |\vec v|^2, which is just the magnitude formula restated. It gives a second, often faster, route to magnitude: ∣v⃗∣=v⃗⋅v⃗|\vec v| = \sqrt{\vec v\cdot\vec v}.

4. Finding the Angle Between Two Vectors

Rearranging the geometric definition gives the formula used to find an angle from components:

cos⁡θ=u⃗⋅v⃗∣u⃗∣∣v⃗∣\cos\theta = \frac{\vec u\cdot\vec v}{|\vec u||\vec v|}

Worked example. Find the angle between u⃗=(122)\vec u=\begin{pmatrix}1\\2\\2\end{pmatrix} and v⃗=(20−1)\vec v=\begin{pmatrix}2\\0\\-1\end{pmatrix}, to the nearest degree.

u⃗⋅v⃗=(1)(2)+(2)(0)+(2)(−1)=2+0−2=0\vec u\cdot\vec v = (1)(2)+(2)(0)+(2)(-1) = 2+0-2 = 0

Since u⃗⋅v⃗=0\vec u\cdot\vec v=0, the vectors are perpendicular: θ=90°\theta=90°, without even needing the magnitudes.

Worked example — the harder case. Find the angle between u⃗=(31−2)\vec u=\begin{pmatrix}3\\1\\-2\end{pmatrix} and v⃗=(−142)\vec v=\begin{pmatrix}-1\\4\\2\end{pmatrix}, to the nearest degree.

u⃗⋅v⃗=(3)(−1)+(1)(4)+(−2)(2)=−3+4−4=−3\vec u\cdot\vec v = (3)(-1)+(1)(4)+(-2)(2) = -3+4-4 = -3 ∣u⃗∣=9+1+4=14,∣v⃗∣=1+16+4=21|\vec u| = \sqrt{9+1+4}=\sqrt{14}, \qquad |\vec v| = \sqrt{1+16+4}=\sqrt{21} cos⁡θ=−31421=−3294≈−0.1750  ⟹  θ≈100.1°\cos\theta = \frac{-3}{\sqrt{14}\sqrt{21}} = \frac{-3}{\sqrt{294}} \approx -0.1750 \implies \theta \approx 100.1°

The edge case to notice: the scalar product came out negative, which immediately signals an obtuse angle before any calculator work — a useful sanity check on the final answer (a student who computes θ≈80°\theta\approx 80° from the same numbers has made a sign error somewhere, since a negative cosine can never give an acute angle).

5. Scalar Projection

The scalar projection of u⃗\vec u onto v⃗\vec v is the signed length of the "shadow" u⃗\vec u casts on the line of v⃗\vec v, found by combining the geometric definition with basic trigonometry (∣u⃗∣cos⁡θ|\vec u|\cos\theta is exactly the adjacent-side length in the right triangle formed by dropping a perpendicular from the tip of u⃗\vec u to the line of v⃗\vec v):

projv⃗ u⃗=∣u⃗∣cos⁡θ=u⃗⋅v⃗∣v⃗∣\text{proj}_{\vec v}\,\vec u = |\vec u|\cos\theta = \frac{\vec u\cdot\vec v}{|\vec v|}

This quantity is positive when θ\theta is acute (the shadow falls in the direction of v⃗\vec v) and negative when θ\theta is obtuse (the shadow falls behind the vector's tail).

Worked example. Find the scalar projection of u⃗=(43)\vec u=\begin{pmatrix}4\\3\end{pmatrix} onto v⃗=(10)\vec v=\begin{pmatrix}1\\0\end{pmatrix}.

projv⃗ u⃗=(4)(1)+(3)(0)12+02=41=4\text{proj}_{\vec v}\,\vec u = \frac{(4)(1)+(3)(0)}{\sqrt{1^2+0^2}} = \frac{4}{1} = 4

This matches intuition: projecting onto the xx-axis direction simply reads off the xx-component.

Common Exam Pitfalls

  • Computing the scalar product and expecting a vector back. The scalar product is a single number; if your answer has components, you have mistakenly performed some other operation.
  • Forgetting that u⃗⋅v⃗=0\vec u\cdot\vec v=0 requires both vectors to be non-zero to conclude perpendicularity. A zero vector dotted with anything is zero, but a zero vector has no direction, so "perpendicular" is meaningless for it.
  • Sign-reading errors in the angle formula. A negative cos⁡θ\cos\theta always means an obtuse angle; if a calculator returns an acute angle from a negative cosine value, the calculator mode (degrees vs radians) or an earlier arithmetic slip is the likely cause.
  • Using the wrong vectors for the angle "at a vertex." When asked for the angle of a triangle at vertex BB, use the two vectors emanating from BB (i.e. BA→\overrightarrow{BA} and BC→\overrightarrow{BC}), not AB→\overrightarrow{AB} and BC→\overrightarrow{BC} — mixing directions flips the angle to its supplement.
  • Confusing scalar projection with the projection vector. The scalar projection projv⃗u⃗=u⃗⋅v⃗∣v⃗∣\text{proj}_{\vec v}\vec u=\dfrac{\vec u\cdot\vec v}{|\vec v|} is a number (possibly negative); multiplying it by v^\hat v gives the full vector projection, a different (and more advanced) quantity.
  • Assuming the distributive and commutative properties need re-derivation each time. These follow immediately from the component formula being an ordinary sum of products; cite them, don't re-derive them, to save time under exam pressure.

Summary

  • Geometric definition: u⃗⋅v⃗=∣u⃗∣∣v⃗∣cos⁡θ\vec u\cdot\vec v = |\vec u||\vec v|\cos\theta; component formula: u⃗⋅v⃗=u1v1+u2v2+u3v3\vec u\cdot\vec v = u_1v_1+u_2v_2+u_3v_3 — proven equal via the cosine rule.
  • Perpendicularity test: u⃗⋅v⃗=0  ⟺  u⃗⊥v⃗\vec u\cdot\vec v=0 \iff \vec u\perp\vec v (for non-zero vectors).
  • Properties: commutative, distributive over vector addition, scalars factor out, and v⃗⋅v⃗=∣v⃗∣2\vec v\cdot\vec v=|\vec v|^2.
  • Angle between vectors: cos⁡θ=u⃗⋅v⃗∣u⃗∣∣v⃗∣\cos\theta = \dfrac{\vec u\cdot\vec v}{|\vec u||\vec v|}; a negative scalar product signals an obtuse angle immediately.
  • Scalar projection of u⃗\vec u onto v⃗\vec v: projv⃗ u⃗=u⃗⋅v⃗∣v⃗∣\text{proj}_{\vec v}\,\vec u = \dfrac{\vec u\cdot\vec v}{|\vec v|}, signed according to whether θ\theta is acute or obtuse.