Skip to content

Mathematics · Ch 9 — Three-Dimensional Geometry

Angle Between Two Lines

8

Angle Between Two Lines

Definition. The angle between two lines in space, with direction vectors b⃗1\vec b_1 and b⃗2\vec b_2, is defined as the acute (or right) angle θ\theta between their directions -- taking whichever of the two supplementary angles formed is ≤90∘\le90^\circ, since a direction vector for a line could equally well be taken in either of its two opposite senses (b⃗1\vec b_1 or −b⃗1-\vec b_1); reporting an obtuse angle would make the answer depend on an arbitrary sign choice, so the convention is fixed by always taking the non-negative acute value.

Formula via the dot product -- derivation. For any two vectors, the dot product satisfies b⃗1⋅b⃗2=∣b⃗1∣∣b⃗2∣cos⁡θ0\vec b_1\cdot\vec b_2=|\vec b_1||\vec b_2|\cos\theta_0, where θ0\theta_0 is the actual angle between them as directed vectors (which could be obtuse). Solving for cos⁡θ0\cos\theta_0 and taking the absolute value to enforce the acute-angle convention gives the angle between two lines:

cos⁡θ=∣b⃗1⋅b⃗2∣b⃗1∣∣b⃗2∣∣,soθ=cos⁡−1∣b⃗1⋅b⃗2∣b⃗1∣∣b⃗2∣∣.\cos\theta=\left|\frac{\vec b_1\cdot\vec b_2}{|\vec b_1||\vec b_2|}\right|,\qquad\text{so}\qquad \theta=\cos^{-1}\left|\frac{\vec b_1\cdot\vec b_2}{|\vec b_1||\vec b_2|}\right|.

Written out for direction ratios a1,b1,c1a_1,b_1,c_1 and a2,b2,c2a_2,b_2,c_2 (expanding the dot product and magnitudes into coordinates), this is

cos⁡θ=∣a1a2+b1b2+c1c2a12+b12+c12 a22+b22+c22∣.\cos\theta=\left|\frac{a_1a_2+b_1b_2+c_1c_2}{\sqrt{a_1^2+b_1^2+c_1^2}\,\sqrt{a_2^2+b_2^2+c_2^2}}\right|.

If the two lines are instead given by their direction cosines (l1,m1,n1)(l_1,m_1,n_1) and (l2,m2,n2)(l_2,m_2,n_2) directly, the magnitudes in the denominator are each exactly 11 (Section 4), so the formula simplifies to

cos⁡θ=∣l1l2+m1m2+n1n2∣.\cos\theta=|l_1l_2+m_1m_2+n_1n_2|.

Special cases. Two important conditions follow immediately, and are used constantly without re-deriving the angle each time:

  • Parallel lines (θ=0\theta=0, so cos⁡θ=1\cos\theta=1): this happens exactly when b⃗1\vec b_1 and b⃗2\vec b_2 are scalar multiples of each other, i.e. a1a2=b1b2=c1c2\dfrac{a_1}{a_2}=\dfrac{b_1}{b_2}=\dfrac{c_1}{c_2}.
  • Perpendicular lines (θ=90∘\theta=90^\circ, so cos⁡θ=0\cos\theta=0): this happens exactly when the dot product vanishes, a1a2+b1b2+c1c2=0a_1a_2+b_1b_2+c_1c_2=0 (equivalently l1l2+m1m2+n1n2=0l_1l_2+m_1m_2+n_1n_2=0) -- a simple linear condition, used to find an unknown constant in one line's direction ratios that makes it perpendicular to another given line. …