Scalar product and angles

Consider two (non-zero) vectors a\vec{a} and b\vec{b} and represent them in space as arrows with overlapping tails.

We want to find the (smaller) angle between the two vectors (which will always be between 00^\circ and 180180^\circ). It turns out that the angle is closely related to the scalar product between a\vec a and b\vec b:

cos(α)=abab\boxed{\cos(\alpha)=\frac{\vec{a}\bullet \vec{b}}{\vert\vec{a}\vert\cdot \vert\vec{b}\vert} }

Once we have calculated the value for cos(α)\cos(\alpha), we can calculate α\alpha using cos1\cos^{-1}.

Example 1

Consider the vectors a=(352)\vec{a} = \left(\begin{array}{r} 3\\ 5\\ 2 \end{array}\right) and b=(138)\vec{b}=\left(\begin{array}{r} -1\\ 3\\ 8 \end{array}\right). It is

cos(α)=abab=3(1)+53+2832+52+22(1)2+32+82=283874=0.528\cos(\alpha)=\frac{\vec{a}\bullet \vec{b}}{\vert\vec{a}\vert\cdot \vert\vec{b}\vert} = \frac{3\cdot (-1)+5\cdot 3+2\cdot 8}{\sqrt{3^2+5^2+2^2}\cdot \sqrt{(-1)^2+3^2+8^2}} = \frac{28}{\sqrt{38}\cdot \sqrt{74}} = 0.528

Thus, the smaller angle between a\vec a and b\vec b is α=cos1(0.528)=58.12\alpha = \cos^{-1}(0.528)=58.12^\circ

Exercise 1

Consider the vectors a=(014)\vec{a}=\left(\begin{array}{r} 0\\ 1\\ 4 \end{array}\right) and b=(031)\vec{b}=\left(\begin{array}{r} 0\\ 3\\ 1 \end{array}\right).

  1. Draw the arrows and measure the angle between the two arrows.

  2. Calculate the angle and compare with the measurement.

Solution