 # How to Determine the Angle Between Two Lines

When you want to know the angle between two lines, you can find the angle between their directional vectors. If you have a line $l$ along the vector ${\stackrel{\to }{r}}_{l}=\phantom{\rule{-0.17em}{0ex}}\left(a,b,c\right)$ and a line $m$ along the vector ${\stackrel{\to }{r}}_{m}=\phantom{\rule{-0.17em}{0ex}}\left(d,f,g\right)$, you can find the angle $\alpha$ between the two lines this way:

Formula

### TheAngleBetweenTwoLines

 $\mathrm{cos}\alpha =\frac{{\stackrel{\to }{r}}_{l}\cdot {\stackrel{\to }{r}}_{m}}{\phantom{\rule{-0.17em}{0ex}}|{\stackrel{\to }{r}}_{l}|\cdot \phantom{\rule{-0.17em}{0ex}}|{\stackrel{\to }{r}}_{m}|},\phantom{\rule{2em}{0ex}}\alpha \in \phantom{\rule{-0.17em}{0ex}}\left[0\text{°},180\text{°}\right]$

Note! If $\alpha >90\text{°}$, the real angle between the lines is $\beta =180\text{°}-\alpha$. This is because the angle between two lines always is $\le 90\text{°}$.

Example 1

You have a line $l$ along the vector ${\stackrel{\to }{r}}_{l}=\phantom{\rule{-0.17em}{0ex}}\left(2,3,4\right)$ and a line $m$ along the vector ${\stackrel{\to }{r}}_{m}=\phantom{\rule{-0.17em}{0ex}}\left(1,-2,1\right)$. The angle between them is $\begin{array}{llll}\hfill \mathrm{cos}\alpha & =\frac{\phantom{\rule{-0.17em}{0ex}}\left(2,3,4\right)\cdot \phantom{\rule{-0.17em}{0ex}}\left(1,-2,1\right)}{\phantom{\rule{-0.17em}{0ex}}|\phantom{\rule{-0.17em}{0ex}}\left(2,3,4\right)|\cdot \phantom{\rule{-0.17em}{0ex}}|\phantom{\rule{-0.17em}{0ex}}\left(1,-2,1\right)|}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\frac{2\cdot 1+3\cdot \phantom{\rule{-0.17em}{0ex}}\left(-2\right)+4\cdot 1}{\sqrt{{2}^{2}+{3}^{2}+{4}^{2}}\cdot \sqrt{{1}^{2}+\phantom{\rule{-0.17em}{0ex}}{\left(-2\right)}^{2}+{1}^{2}}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\frac{2-6+4}{\sqrt{29}\cdot \sqrt{6}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =0,\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill \alpha & ={\mathrm{cos}}^{-1}\phantom{\rule{-0.17em}{0ex}}\left(0\right)=\frac{\pi }{2}=90\text{°}.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

The lines are perpendicular!