Direction Cosines of a Line

Chapter 10 defined direction cosines for a vector. This chapter needs them for a line — and a line brings one new subtlety: it can be traversed in two opposite directions.

If a directed line LL through the origin makes angles α,β,γ\alpha, \beta, \gamma with the positive xx-, yy- and zz-axes, its direction cosines are

l=cos⁡α,m=cos⁡β,n=cos⁡γ,l2+m2+n2=1l = \cos\alpha, \quad m = \cos\beta, \quad n = \cos\gamma, \qquad l^2 + m^2 + n^2 = 1

Directed line with direction angles and the ratios to cosines pipeline

Key Point (the two-sets fact): reversing the direction of LL replaces each angle by its supplement, flipping the sign of every cosine. So an undirected line has exactly two sets of direction cosines, (l,m,n)(l, m, n) and (−l,−m,−n)(-l, -m, -n); choosing a direction picks one. For a line not through the origin, use the parallel line through the origin — parallel lines share direction cosines.

Direction Ratios

Any three numbers a,b,ca, b, c proportional to the direction cosines are called direction ratios of the line: a=λla = \lambda l, b=λmb = \lambda m, c=λnc = \lambda n for some λ≠0\lambda \neq 0. A line has infinitely many sets of direction ratios (scale by anything nonzero); it has only the two sets of cosines.

Ratios to cosines — normalise:

l=±aa2+b2+c2,m=±ba2+b2+c2,n=±ca2+b2+c2l = \pm\frac{a}{\sqrt{a^2 + b^2 + c^2}}, \quad m = \pm\frac{b}{\sqrt{a^2 + b^2 + c^2}}, \quad n = \pm\frac{c}{\sqrt{a^2 + b^2 + c^2}}

taking the same sign throughout (the two sign choices are the two directions of the line).

The Line Through Two Points, and Collinearity

Direction cosines from two points

Exactly one line passes through P(x1,y1,z1)P(x_1, y_1, z_1) and Q(x2,y2,z2)Q(x_2, y_2, z_2). Dropping perpendiculars to the coordinate planes (right-triangle geometry) gives its direction cosines directly:

(x2−x1PQ, y2−y1PQ, z2−z1PQ),PQ=(x2−x1)2+(y2−y1)2+(z2−z1)2\left(\frac{x_2 - x_1}{PQ}, \ \frac{y_2 - y_1}{PQ}, \ \frac{z_2 - z_1}{PQ}\right), \qquad PQ = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2 + (z_2-z_1)^2}

Equivalently: the coordinate differences are direction ratios (x2−x1x_2 - x_1, y2−y1y_2 - y_1, z2−z1z_2 - z_1 — or all negated), and dividing by the distance normalises them.

Collinearity of three points

AA, BB, CC are collinear exactly when the direction ratios of ABAB and of BCBC are proportional — the two segments are parallel and share the point BB, forcing one straight line.

Key Point (exam workflow): for every direction-cosine computation the routine is identical: write the ratios (given, or as coordinate differences), compute a2+b2+c2\sqrt{a^2 + b^2 + c^2}, divide. The only decisions are the sign convention and keeping each cosine attached to its own axis. Zero components are fine — a zero cosine means the line is perpendicular to that axis, as with the xx-axis itself, whose cosines are (1,0,0)(1, 0, 0).

Solved Examples

Example 1: From angles to cosines

A line makes angles 90∘,60∘,30∘90^\circ, 60^\circ, 30^\circ with the positive xx-, yy- and zz-axes. Find its direction cosines.

Solution:

  1. Take cosines: l=cos⁡90∘=0l = \cos 90^\circ = 0, m=cos⁡60∘=12m = \cos 60^\circ = \dfrac{1}{2}, n=cos⁡30∘=32n = \cos 30^\circ = \dfrac{\sqrt{3}}{2}.
  2. Check: 0+14+34=10 + \dfrac{1}{4} + \dfrac{3}{4} = 1. ✓

Answer: (0,12,32)\left(0, \dfrac{1}{2}, \dfrac{\sqrt{3}}{2}\right) — the zero first entry says the line is perpendicular to the xx-axis.


Example 2: From ratios to cosines

A line has direction ratios 2,−1,−22, -1, -2. Determine its direction cosines.

Solution:

  1. Normalising factor: 4+1+4=3\sqrt{4 + 1 + 4} = 3.
  2. Divide: (23,−13,−23)\left(\dfrac{2}{3}, -\dfrac{1}{3}, -\dfrac{2}{3}\right).

Answer: (23,−13,−23)\left(\dfrac{2}{3}, -\dfrac{1}{3}, -\dfrac{2}{3}\right) (or the all-negated set — the other direction along the same line).


Example 3: Through two points

Find the direction cosines of the line through (−2,4,−5)(-2, 4, -5) and (1,2,3)(1, 2, 3).

Solution:

  1. Ratios = differences: (1−(−2), 2−4, 3−(−5))=(3,−2,8)\left(1 - (-2), \ 2 - 4, \ 3 - (-5)\right) = (3, -2, 8).
  2. Distance: PQ=9+4+64=77PQ = \sqrt{9 + 4 + 64} = \sqrt{77}.
  3. Divide: (377,−277,877)\left(\dfrac{3}{\sqrt{77}}, -\dfrac{2}{\sqrt{77}}, \dfrac{8}{\sqrt{77}}\right).

Answer: (377,−277,877)\left(\dfrac{3}{\sqrt{77}}, \dfrac{-2}{\sqrt{77}}, \dfrac{8}{\sqrt{77}}\right).


Example 4: The axes themselves

Find the direction cosines of the xx-, yy- and zz-axes.

Solution:

  1. The xx-axis makes angles 0∘,90∘,90∘0^\circ, 90^\circ, 90^\circ with the three axes: cosines (1,0,0)(1, 0, 0).
  2. Similarly: yy-axis (0,1,0)(0, 1, 0); zz-axis (0,0,1)(0, 0, 1).

Answer: (1,0,0)(1,0,0), (0,1,0)(0,1,0), (0,0,1)(0,0,1) — the components of i^,j^,k^\hat{i}, \hat{j}, \hat{k}, as they must be.


Example 5: Collinearity via ratios

Show that A(2,3,−4)A(2, 3, -4), B(1,−2,3)B(1, -2, 3) and C(3,8,−11)C(3, 8, -11) are collinear.

Solution:

  1. Ratios of ABAB: (1−2, −2−3, 3+4)=(−1,−5,7)(1-2, \ -2-3, \ 3+4) = (-1, -5, 7).
  2. Ratios of BCBC: (3−1, 8+2, −11−3)=(2,10,−14)(3-1, \ 8+2, \ -11-3) = (2, 10, -14).
  3. Proportionality: (2,10,−14)=−2×(−1,−5,7)(2, 10, -14) = -2 \times (-1, -5, 7) — parallel segments sharing BB.

Answer: A,B,CA, B, C are collinear.


Example 6: Direction cosines of triangle sides

Find the direction cosines of the sides of the triangle with vertices A(3,5,−4)A(3, 5, -4), B(−1,1,2)B(-1, 1, 2) and C(−5,−5,−2)C(-5, -5, -2).

Solution:

  1. Side ABAB: ratios (−4,−4,6)(-4, -4, 6), length 16+16+36=217\sqrt{16 + 16 + 36} = 2\sqrt{17}; cosines (−217,−217,317)\left(\dfrac{-2}{\sqrt{17}}, \dfrac{-2}{\sqrt{17}}, \dfrac{3}{\sqrt{17}}\right).
  2. Side BCBC: ratios (−4,−6,−4)(-4, -6, -4), length 16+36+16=217\sqrt{16 + 36 + 16} = 2\sqrt{17}; cosines (−217,−317,−217)\left(\dfrac{-2}{\sqrt{17}}, \dfrac{-3}{\sqrt{17}}, \dfrac{-2}{\sqrt{17}}\right).
  3. Side CACA: ratios (8,10,−2)(8, 10, -2), length 64+100+4=242\sqrt{64 + 100 + 4} = 2\sqrt{42}; cosines (442,542,−142)\left(\dfrac{4}{\sqrt{42}}, \dfrac{5}{\sqrt{42}}, \dfrac{-1}{\sqrt{42}}\right).

Answer: as computed — three independent runs of the same ratio-normalise routine; note the accidental equality of ∣AB∣|AB| and ∣BC∣|BC| (an isosceles triangle).