What this lesson covers

With direction cosines in hand, the angle between two lines is a short calculation. This lesson gives the cosine and sine of that angle, Lagrange's identity which links them, the directions of the angle bisectors, and conditions for lines to be perpendicular or parallel, including the case where the direction cosines are only known through two equations.

Lagrange's identity

For any two triples (l1,m1,n1)(l_1, m_1, n_1) and (l2,m2,n2)(l_2, m_2, n_2),

(l12+m12+n12)(l22+m22+n22)−(l1l2+m1m2+n1n2)2=(l1m2−l2m1)2+(m1n2−m2n1)2+(n1l2−n2l1)2.(l_1^2 + m_1^2 + n_1^2)(l_2^2 + m_2^2 + n_2^2) - (l_1l_2 + m_1m_2 + n_1n_2)^2 = (l_1m_2 - l_2m_1)^2 + (m_1n_2 - m_2n_1)^2 + (n_1l_2 - n_2l_1)^2.

When both triples are direction cosines the left side is 1−cos⁡2θ=sin⁡2θ1 - \cos^2\theta = \sin^2\theta, which gives the sine formula below.

Angle between two lines

If θ\theta is the acute angle between two lines with d.c.'s (l1,m1,n1)(l_1, m_1, n_1) and (l2,m2,n2)(l_2, m_2, n_2), then

cos⁡θ=∣l1l2+m1m2+n1n2∣,sin⁡θ=∑(l1m2−l2m1)2.\displaystyle \cos\theta = |l_1l_2 + m_1m_2 + n_1n_2|, \qquad \sin\theta = \sqrt{\sum (l_1m_2 - l_2m_1)^2}.

If the lines have d.r.'s (a1,b1,c1)(a_1, b_1, c_1) and (a2,b2,c2)(a_2, b_2, c_2), then

cos⁡θ=∣a1a2+b1b2+c1c2∣a12+b12+c12 a22+b22+c22.\displaystyle \cos\theta = \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}}.

Bisectors of the angle between two lines

If (l1,m1,n1)(l_1, m_1, n_1) and (l2,m2,n2)(l_2, m_2, n_2) are the d.c.'s of two intersecting lines, the d.c.'s of the lines bisecting the angles between them are proportional to

(l1±l2,  m1±m2,  n1±n2).(l_1 \pm l_2,\; m_1 \pm m_2,\; n_1 \pm n_2).

Adding two unit vectors gives a vector along the bisector of the angle between them. Dividing by the length gives the actual d.c.'s of the bisectors:

(l1+l22cos⁡θ2,m1+m22cos⁡θ2,n1+n22cos⁡θ2),(l1−l22sin⁡θ2,m1−m22sin⁡θ2,n1−n22sin⁡θ2),\displaystyle \left(\frac{l_1 + l_2}{2\cos\frac{\theta}{2}}, \frac{m_1 + m_2}{2\cos\frac{\theta}{2}}, \frac{n_1 + n_2}{2\cos\frac{\theta}{2}}\right), \qquad \left(\frac{l_1 - l_2}{2\sin\frac{\theta}{2}}, \frac{m_1 - m_2}{2\sin\frac{\theta}{2}}, \frac{n_1 - n_2}{2\sin\frac{\theta}{2}}\right),

where θ\theta is the angle between the lines.

Perpendicular and parallel lines

For lines with d.c.'s (l1,m1,n1)(l_1, m_1, n_1) and (l2,m2,n2)(l_2, m_2, n_2):

  • they are perpendicular if l1l2+m1m2+n1n2=0l_1l_2 + m_1m_2 + n_1n_2 = 0;
  • they are parallel if l1l2=m1m2=n1n2\displaystyle \dfrac{l_1}{l_2} = \dfrac{m_1}{m_2} = \dfrac{n_1}{n_2}.

For lines with d.r.'s (a1,b1,c1)(a_1, b_1, c_1) and (a2,b2,c2)(a_2, b_2, c_2):

  • they are perpendicular if a1a2+b1b2+c1c2=0a_1a_2 + b_1b_2 + c_1c_2 = 0;
  • they are parallel if a1a2=b1b2=c1c2\displaystyle \dfrac{a_1}{a_2} = \dfrac{b_1}{b_2} = \dfrac{c_1}{c_2}.

Lines given by two relations

Sometimes the d.c.'s of two lines are given only as the two solutions of a pair of equations.

If the d.c.'s (l,m,n)(l, m, n) of two lines satisfy al+bm+cn=0al + bm + cn = 0 and fmn+gnl+hlm=0fmn + gnl + hlm = 0, then the lines are

  • perpendicular if fa+gb+hc=0\displaystyle \dfrac{f}{a} + \dfrac{g}{b} + \dfrac{h}{c} = 0;
  • parallel if af±bg±ch=0\sqrt{af} \pm \sqrt{bg} \pm \sqrt{ch} = 0.

If the d.c.'s satisfy al+bm+cn=0al + bm + cn = 0 and ul2+vm2+wn2=0ul^2 + vm^2 + wn^2 = 0, the lines are

  • perpendicular if ∑a2(v+w)=a2(v+w)+b2(w+u)+c2(u+v)=0\displaystyle \sum a^2(v + w) = a^2(v + w) + b^2(w + u) + c^2(u + v) = 0;
  • parallel if a2u+b2v+c2w=0\displaystyle \dfrac{a^2}{u} + \dfrac{b^2}{v} + \dfrac{c^2}{w} = 0.

To find the actual angle, eliminate one of l,m,nl, m, n using the linear equation and solve the quadratic, as in Example 3.

Example 1

Find the angle between the lines with d.r.'s (1,1,2)(1, 1, 2) and (2,−1,1)(2, -1, 1), and check with the sine formula.

cos⁡θ=∣2−1+2∣6 6=36=12,θ=60∘.\displaystyle \cos\theta = \frac{|2 - 1 + 2|}{\sqrt{6}\,\sqrt{6}} = \frac{3}{6} = \frac{1}{2}, \qquad \theta = 60^\circ.

The d.c.'s are 16(1,1,2)\displaystyle \tfrac{1}{\sqrt{6}}(1, 1, 2) and 16(2,−1,1)\displaystyle \tfrac{1}{\sqrt{6}}(2, -1, 1). The three cross terms are 16(−1−2)\displaystyle \tfrac{1}{6}(-1 - 2), 16(1+2)\displaystyle \tfrac{1}{6}(1 + 2) and 16(4−1)\displaystyle \tfrac{1}{6}(4 - 1), so sin⁡2θ=9+9+936=34\displaystyle \sin^2\theta = \tfrac{9 + 9 + 9}{36} = \tfrac{3}{4} and sin⁡θ=32\displaystyle \sin\theta = \tfrac{\sqrt{3}}{2}, as expected.

Example 2

Find kk so that the lines with d.r.'s (2,k,3)(2, k, 3) and (1,−2,4)(1, -2, 4) are perpendicular, and kk so that (2,k,6)(2, k, 6) and (1,2,3)(1, 2, 3) are parallel.

Perpendicular: 2−2k+12=02 - 2k + 12 = 0, so k=7k = 7. Parallel: 21=k2=63\displaystyle \tfrac{2}{1} = \tfrac{k}{2} = \tfrac{6}{3}, so k=4k = 4.

Example 3

Find the angle between the lines whose d.c.'s satisfy l+m+n=0l + m + n = 0 and 2lm+2nl−mn=02lm + 2nl - mn = 0.

Put n=−(l+m)n = -(l + m) in the second equation. Then 2nl=−2l(l+m)2nl = -2l(l + m) and −mn=m(l+m)-mn = m(l + m), so

2lm−2l2−2lm+lm+m2=0m2+lm−2l2=0(m−l)(m+2l)=0.\begin{aligned} 2lm - 2l^2 - 2lm + lm + m^2 &= 0 \\ m^2 + lm - 2l^2 &= 0 \\ (m - l)(m + 2l) &= 0. \end{aligned}

If m=lm = l, then n=−2ln = -2l, giving d.r.'s (1,1,−2)(1, 1, -2). If m=−2lm = -2l, then n=ln = l, giving d.r.'s (1,−2,1)(1, -2, 1). So

cos⁡θ=∣1−2−2∣6 6=12,θ=60∘.\displaystyle \cos\theta = \frac{|1 - 2 - 2|}{\sqrt{6}\,\sqrt{6}} = \frac{1}{2}, \qquad \theta = 60^\circ.

Practice

  1. Find the acute angle between the lines with d.r.'s (1,−1,0)(1, -1, 0) and (0,1,−1)(0, 1, -1).
  2. Find the angle between the lines with d.c.'s (27,37,−67)\displaystyle \left(\tfrac{2}{7}, \tfrac{3}{7}, -\tfrac{6}{7}\right) and (67,27,37)\displaystyle \left(\tfrac{6}{7}, \tfrac{2}{7}, \tfrac{3}{7}\right).
  3. Find kk if the lines with d.r.'s (k,2,−1)(k, 2, -1) and (3,−k,4)(3, -k, 4) are perpendicular.
  4. Find d.r.'s of a line perpendicular to both the lines with d.r.'s (1,2,3)(1, 2, 3) and (2,3,1)(2, 3, 1).
  5. Show that the lines whose d.c.'s satisfy l+m+n=0l + m + n = 0 and mn+nl−2lm=0mn + nl - 2lm = 0 are perpendicular.
  6. Find the angle between the lines whose d.c.'s satisfy l+m+n=0l + m + n = 0 and l2+m2−n2=0l^2 + m^2 - n^2 = 0.
  7. Find the d.c.'s of the bisectors of the angles between the xx axis and the yy axis.

Answers

Show answers
  1. cos⁡θ=∣0−1+0∣22=12\displaystyle \cos\theta = \tfrac{|0 - 1 + 0|}{\sqrt{2}\sqrt{2}} = \tfrac{1}{2}, so 60∘60^\circ.
  2. 12+6−1849=0\displaystyle \tfrac{12 + 6 - 18}{49} = 0, so 90∘90^\circ.
  3. 3k−2k−4=03k - 2k - 4 = 0, so k=4k = 4.
  4. Solve a+2b+3c=0a + 2b + 3c = 0 and 2a+3b+c=02a + 3b + c = 0 by cross multiplication: (a,b,c)(a, b, c) is proportional to (2−9,6−1,3−4)=(−7,5,−1)(2 - 9, 6 - 1, 3 - 4) = (-7, 5, -1), or (7,−5,1)(7, -5, 1).
  5. Here a=b=c=1a = b = c = 1, f=1f = 1, g=1g = 1, h=−2h = -2, and 11+11+−21=0\displaystyle \tfrac{1}{1} + \tfrac{1}{1} + \tfrac{-2}{1} = 0.
  6. With n=−(l+m)n = -(l + m): l2+m2−(l+m)2=−2lm=0l^2 + m^2 - (l + m)^2 = -2lm = 0, so l=0l = 0 or m=0m = 0. The d.r.'s are (0,1,−1)(0, 1, -1) and (1,0,−1)(1, 0, -1), and cos⁡θ=12\displaystyle \cos\theta = \tfrac{1}{2}, so θ=60∘\theta = 60^\circ.
  7. θ=90∘\theta = 90^\circ, so 2cos⁡45∘=2sin⁡45∘=22\cos 45^\circ = 2\sin 45^\circ = \sqrt{2}. The bisectors have d.c.'s (12,12,0)\displaystyle \left(\tfrac{1}{\sqrt{2}}, \tfrac{1}{\sqrt{2}}, 0\right) and (12,−12,0)\displaystyle \left(\tfrac{1}{\sqrt{2}}, -\tfrac{1}{\sqrt{2}}, 0\right).