Skip to main content

Section 3.1 Law of Cosines and the Angle between Two Vectors

Consider two vectors \(\mathbf u\) and \(\mathbf v\text{,}\) and let \(\mathbf w = \mathbf u - \mathbf v\text{,}\) as shown in FigureΒ 3.1. By the law of cosines,
\begin{equation} |\mathbf w|^2 = |\mathbf u|^2 + |\mathbf v|^2 - 2|\mathbf u||\mathbf v|\cos\theta.\tag{3.1} \end{equation}
Diagram Exploration Keyboard Controls
Key Action
Enter, A Activate keyboard driven exploration
B Activate menu driven exploration
Escape Leave exploration mode
Cursor down Explore next lower level
Cursor up Explore next upper level
Cursor right Explore next element on level
Cursor left Explore previous element on level
X Toggle expert mode
W Extra details if available
Space Repeat speech
M Activate step magnification
Comma Activate direct magnification
N Deactivate magnification
Z Toggle subtitles
C Cycle contrast settings
T Monochrome colours
L Toggle language (if available)
K Kill current sound
Y Stop sound output
O Start and stop sonification
P Repeat sonification output
Figure 3.1. The vectors \(\mathbf u\text{,}\) \(\mathbf v\text{,}\) and \(\mathbf w = \mathbf u - \mathbf v\text{,}\) together with the angle \(\theta\) between \(\mathbf u\) and \(\mathbf v\text{.}\)

Proof.

Watch the video below for a proof of the law of cosines using vectors.
Figure 3.2. Proving the law of cosines: drop a perpendicular from the tip of \(\mathbf u\) and apply the Pythagorean theorem to the right triangle whose hypotenuse is \(\mathbf w = \mathbf u - \mathbf v\text{.}\)
Writing \(\mathbf u = \langle u_1, u_2, u_3\rangle\) and \(\mathbf v = \langle v_1, v_2, v_3\rangle\text{,}\) note that \(\mathbf w = \mathbf u - \mathbf v\text{,}\) and hence
\begin{equation} \begin{aligned} |\mathbf w|^2 \amp = |\mathbf u - \mathbf v|^2 = (u_1-v_1)^2 + (u_2-v_2)^2 + (u_3-v_3)^2 \\ \amp = (u_1^2+u_2^2+u_3^2) + (v_1^2+v_2^2+v_3^2) - 2(u_1v_1+u_2v_2+u_3v_3). \end{aligned}\tag{3.2} \end{equation}
Also, from the law of cosines in (3.1) we have
\begin{equation} |\mathbf w|^2 = (u_1^2+u_2^2+u_3^2) + (v_1^2+v_2^2+v_3^2) - 2|\mathbf u||\mathbf v|\cos\theta.\tag{3.3} \end{equation}
From (3.2) and (3.3), it follows that \(u_1v_1+u_2v_2+u_3v_3 = |\mathbf u||\mathbf v|\cos\theta\text{,}\) and therefore the angle between the two vectors \(\mathbf u\) and \(\mathbf v\) can be evaluated using the following equation.
You have attempted of activities on this page.