Scalar Product
The scalar product turns two vectors into a single number — and that number tells you, precisely, the angle between them.
Definition and basic properties
For $\mathbf{a}=(a_1,a_2,a_3)$ and $\mathbf{b}=(b_1,b_2,b_3)$: $$\mathbf{a}\cdot\mathbf{b}=a_1b_1+a_2b_2+a_3b_3=|\mathbf{a}||\mathbf{b}|\cos\theta$$ where $\theta$ is the angle between the vectors when placed tail to tail. The result is always a scalar, not a vector.
$\mathbf{a}\cdot\mathbf{b}=\mathbf{b}\cdot\mathbf{a}$ (commutative); $\mathbf{a}\cdot(\mathbf{b}+\mathbf{c})=\mathbf{a}\cdot\mathbf{b}+\mathbf{a}\cdot\mathbf{c}$ (distributive); $\mathbf{a}\cdot\mathbf{a}=|\mathbf{a}|^2$; and two non-zero vectors are perpendicular exactly when $\mathbf{a}\cdot\mathbf{b}=0$.
$\mathbf{a}\cdot\mathbf{b}=3(1)+(-1)(4)+2(-2)=3-4-4=-5$.
Why the geometric and algebraic definitions agree
Finding the angle between two vectors
$$\cos\theta=\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{a}||\mathbf{b}|}$$
$\mathbf{a}\cdot\mathbf{b}=2(1)+1(3)+(-2)(4)=2+3-8=-3$.
$|\mathbf{a}|=\sqrt{4+1+4}=3$, $|\mathbf{b}|=\sqrt{1+9+16}=\sqrt{26}$.
$\mathbf{a}\cdot\mathbf{b}=3(2)+k(-1)+(-1)(5)=6-k-5=1-k$.
Perpendicular $\Rightarrow 1-k=0 \Rightarrow k=1$.
Using the scalar product with position vectors
$\vec{AB}=B-A=(2,1,-1)$, $\vec{AC}=C-A=(1,-1,2)$.
$\vec{AB}\cdot\vec{AC}=2(1)+1(-1)+(-1)(2)=2-1-2=-1$.
$|\vec{AB}|=\sqrt{4+1+1}=\sqrt6$, $|\vec{AC}|=\sqrt{1+1+4}=\sqrt6$.
$\cos(\angle BAC)=\dfrac{-1}{6}=-0.1\overline{6} \Rightarrow \angle BAC=99.6°$ (3 s.f.)
When finding an angle at a vertex of a triangle (or between two edges meeting at a point), always form both direction vectors starting from that same vertex — using vectors in inconsistent directions (e.g. $\vec{AB}$ and $\vec{CA}$ instead of $\vec{AB}$ and $\vec{AC}$) gives the supplementary angle instead of the one required.
Exam-style questions
Question 1 5 marks
Find the angle between $\mathbf{a}=(1,-2,2)$ and $\mathbf{b}=(2,2,1)$, giving your answer to 1 decimal place.
$\mathbf{a}\cdot\mathbf{b}=1(2)+(-2)(2)+2(1)=2-4+2=0$ (M1, A1)
Since the scalar product is $0$, the vectors are perpendicular: $\theta=90°$. (A1, B1, B1)
Question 2 6 marks
Given $\mathbf{a}=(4,-1,3)$ and $\mathbf{b}=(1,2,-2)$, find $\mathbf{a}\cdot\mathbf{b}$, $|\mathbf{a}|$, $|\mathbf{b}|$, and the angle between $\mathbf{a}$ and $\mathbf{b}$ to 1 decimal place.
$\mathbf{a}\cdot\mathbf{b}=4(1)+(-1)(2)+3(-2)=4-2-6=-4$ (M1, A1)
$|\mathbf{a}|=\sqrt{16+1+9}=\sqrt{26}$, $|\mathbf{b}|=\sqrt{1+4+4}=3$ (A1)
$\cos\theta=\dfrac{-4}{3\sqrt{26}}=-0.2614\ldots \Rightarrow \theta=105.2°$ (M1, A1, A1)
Question 3 7 marks
Points $A(0,1,1)$, $B(2,0,3)$, $C(1,3,0)$ form a triangle. Find the angle $ABC$.
$\vec{BA}=A-B=(-2,1,-2)$, $\vec{BC}=C-B=(-1,3,-3)$ (M1, A1)
$\vec{BA}\cdot\vec{BC}=(-2)(-1)+1(3)+(-2)(-3)=2+3+6=11$ (M1, A1)
$|\vec{BA}|=\sqrt{4+1+4}=3$, $|\vec{BC}|=\sqrt{1+9+9}=\sqrt{19}$ (A1)
$\cos(\angle ABC)=\dfrac{11}{3\sqrt{19}}=0.8412\ldots \Rightarrow \angle ABC=32.7°$ (3 s.f.) (M1, A1)