11b.4. Direction cosines

Recall the dot product formula $\mathbf{a} \cdot \mathbf{b} = |\mathbf{a}| \, |\mathbf{b}| \cos \theta$, which is often used to find angles between two vectors $\mathbf{a}$ and $\mathbf{b}$. If we want to find the angle $\mathbf{a}$ makes with the $x$-axis, then we can use the direction vector of the $x$-axis $\mathbf{i} = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}$.

Let $\mathbf{a} = \begin{pmatrix} x \\ y \\ z \end{pmatrix}$ and $\theta_x$ be the angle $\mathbf{a}$ makes with the $x$-axis. The dot product formula then gives us $$ \begin{pmatrix} x \\ y \\ z \end{pmatrix} \cdot \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} = \left | \begin{pmatrix} x \\ y \\ z \end{pmatrix} \right | \, \left | \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} \right | \cos \theta_x$$ Simplifying gives us $\cos \theta_x = \displaystyle \frac{x}{\sqrt{x^2+y^2+z^2}}$. We call $\cos \theta_x$ the direction cosine of $\mathbf{a}$ with respect to the $x$-axis and denote it by $\alpha$.

If we repeat the process for the $y$- and $z$-axis, denoting the angles by $\theta_y$ and $\theta_z$ and the direction cosines by $\beta$ and $\gamma$, we get:

It can be easily checked that the three direction cosines satisfy the formula

This means that, once we have two of the direction cosines, we can determine the last one (up to a $\pm$) and can thus deduce the original vector itself. This is illustrated in the second example below.

Solution to examples

1. It is given that $\mathbf{a} = -\mathbf{i} + 2 \mathbf{j} + 3 \mathbf{k}$. Find the cosines of the angle $\mathbf{a}$ makes with the $x$, $y$ and $z$ axis respectively.

Solution:
Direction cosine with respect to the $x$-axis, $\alpha = \frac{-1}{\sqrt{14}} $
Direction cosine with respect to the $y$-axis, $\beta = \frac{2}{\sqrt{14}} $
Direction cosine with respect to the $z$-axis, $\gamma = \frac{3}{\sqrt{14}} $ .


2. It is given that the direction cosines of a vector $\mathbf{b}$ with respect to the $x$ -and $y$- axes are $\frac{2}{\sqrt{6}}$ and $\frac{-1}{\sqrt{6}}$ respectively. Find two possible vectors $\mathbf{b}$.

Solution: Since $\alpha^2+\beta^2 + \gamma^2 = 1,$
$\frac{4}{6} + \frac{1}{6} + \gamma^2 = 1$
Hence $\gamma = \pm \frac{1}{\sqrt{6}}$.
Thus $\mathbf{b} = \begin{pmatrix} 2 \\ -1 \\ 1 \end{pmatrix}$ or $\mathbf{b} = \begin{pmatrix} 2 \\ -1 \\ -1 \end{pmatrix}$