Math Lab
Home/Class XII/Ch 11/Direction cosines, direction ratios, and lines

Direction cosines, direction ratios, and lines

A line in three-dimensional space has a direction, and any two parallel lines share that direction. We capture direction quantitatively by the angles the line makes with the three coordinate axes , the direction cosines , or by any triple proportional to them , the direction ratios.

Direction cosines

If a directed line makes angles α,β,γ\alpha, \beta, \gamma with the positive xx-, yy-, zz-axes, its direction cosines are l=cosα,m=cosβ,n=cosγ.l = \cos\alpha, \quad m = \cos\beta, \quad n = \cos\gamma.

These satisfy l2+m2+n2=1.l^2 + m^2 + n^2 = 1.

For an undirected line, the direction cosines are defined up to a simultaneous sign change , (l,m,n)(l, m, n) and (l,m,n)(-l, -m, -n) describe the same line, just two opposite orientations.

Direction ratios

Any triple (a,b,c)(a, b, c) proportional to (l,m,n)(l, m, n) , i.e. a=kla = kl, b=kmb = km, c=knc = kn for some k0k \ne 0 , is called a set of direction ratios of the line. Direction ratios are not unique; you can multiply by any non-zero scalar.

Given direction ratios (a,b,c)(a, b, c), direction cosines are recovered by l=aa2+b2+c2,m=ba2+b2+c2,n=ca2+b2+c2.l = \frac{a}{\sqrt{a^2 + b^2 + c^2}}, \quad m = \frac{b}{\sqrt{a^2 + b^2 + c^2}}, \quad n = \frac{c}{\sqrt{a^2 + b^2 + c^2}}.

From two points

A line through points P=(x1,y1,z1)P = (x_1, y_1, z_1) and Q=(x2,y2,z2)Q = (x_2, y_2, z_2) has direction PQ=(x2x1,y2y1,z2z1)\vec{PQ} = (x_2 - x_1, y_2 - y_1, z_2 - z_1). So direction ratios are simply (x2x1,y2y1,z2z1)(x_2 - x_1, y_2 - y_1, z_2 - z_1) , coordinate differences.

Why l2+m2+n2=1l^2 + m^2 + n^2 = 1

If u\vec u is the unit vector along the line, u=(l,m,n)\vec u = (l, m, n). Then u2=l2+m2+n2=1|\vec u|^2 = l^2 + m^2 + n^2 = 1. This identity replaces a key piece of two-dimensional intuition: in 2D the angle of a line was a single number θ\theta with cos2θ+sin2θ=1\cos^2\theta + \sin^2\theta = 1; in 3D you need three direction cosines satisfying one constraint.

Conditions for special lines

  • Line parallel to xx-axis: (l,m,n)=(±1,0,0)(l, m, n) = (\pm 1, 0, 0).
  • Line in the xyxy-plane: n=0n = 0, so l2+m2=1l^2 + m^2 = 1.
  • Line through origin and (a,b,c)(a, b, c): direction ratios (a,b,c)(a, b, c).

Two lines: angle and special positions

If two lines have direction ratios (a1,b1,c1)(a_1, b_1, c_1) and (a2,b2,c2)(a_2, b_2, c_2), the angle between them is given by cosθ=a1a2+b1b2+c1c2a12+b12+c12a22+b22+c22.\cos\theta = \frac{|a_1 a_2 + b_1 b_2 + c_1 c_2|}{\sqrt{a_1^2 + b_1^2 + c_1^2}\sqrt{a_2^2 + b_2^2 + c_2^2}}. (The absolute value forces θ[0,π/2]\theta \in [0, \pi/2].)

Perpendicular: a1a2+b1b2+c1c2=0a_1 a_2 + b_1 b_2 + c_1 c_2 = 0.

Parallel: a1a2=b1b2=c1c2\dfrac{a_1}{a_2} = \dfrac{b_1}{b_2} = \dfrac{c_1}{c_2}.

Worked examples

Example 1. Find the direction cosines of the line joining (1,2,3)(1, 2, 3) and (4,6,3)(4, 6, 3).

Direction ratios (3,4,0)(3, 4, 0). Magnitude 9+16+0=5\sqrt{9 + 16 + 0} = 5. Direction cosines (3/5,4/5,0)(3/5, 4/5, 0).

Example 2. Show that the line making equal angles with all three positive coordinate axes has direction cosines (1/3,1/3,1/3)(1/\sqrt 3, 1/\sqrt 3, 1/\sqrt 3).

l=m=nl = m = n, so 3l2=13 l^2 = 1, l=±1/3l = \pm 1/\sqrt 3.

Example 3. Find the angle between the lines with direction ratios (1,2,1)(1, 2, 1) and (2,3,1)(2, 3, 1).

cosθ=2+6+1614=984=9221\cos\theta = \dfrac{|2 + 6 + 1|}{\sqrt 6 \cdot \sqrt{14}} = \dfrac{9}{\sqrt{84}} = \dfrac{9}{2\sqrt{21}}.

Example 4. Find λ\lambda if the lines with direction ratios (1,λ,3)(1, \lambda, 3) and (2,1,1)(2, 1, -1) are perpendicular.

2+λ3=02 + \lambda - 3 = 0, so λ=1\lambda = 1.

Example 5. A line makes angles 60,60,γ60^\circ, 60^\circ, \gamma with the axes. Find γ\gamma.

cos260+cos260+cos2γ=11/4+1/4+cos2γ=1\cos^2 60^\circ + \cos^2 60^\circ + \cos^2\gamma = 1 \Rightarrow 1/4 + 1/4 + \cos^2\gamma = 1, so cos2γ=1/2\cos^2\gamma = 1/2, γ=45\gamma = 45^\circ or 135135^\circ.

Example 6. Are the lines through (1,1,1)(4,4,4)(1, 1, 1) \to (4, 4, 4) and through (2,0,0)(8,6,6)(2, 0, 0) \to (8, 6, 6) parallel?

Direction ratios: (3,3,3)(1,1,1)(3, 3, 3) \propto (1, 1, 1); (6,6,6)(1,1,1)(6, 6, 6) \propto (1, 1, 1). Same direction. Yes, parallel.

Try it yourself

  1. Direction cosines of a line with direction ratios (2,3,6)(2, 3, 6).
  2. Find the angle between lines with direction ratios (1,1,2)(1, 1, 2) and (2,1,1)(2, 1, 1).
  3. Show that lines with direction ratios (2,3,1)(2, 3, -1) and (1,2,4)(1, -2, -4) are perpendicular.
  4. Find λ\lambda if lines with direction ratios (3,2,λ)(3, 2, \lambda) and (1,1,2)(1, 1, -2) are perpendicular.
  5. A line makes angles 4545^\circ and 6060^\circ with the xx- and yy-axes. Find the angle with the zz-axis.
  6. Show that the line joining (0,0,0)(0, 0, 0) and (1,1,1)(1, 1, 1) makes equal angles with all coordinate axes.
  7. Find direction cosines for the zz-axis.
  8. Find direction ratios for the line joining (2,3,1)(2, -3, 1) to (5,1,2)(5, 1, -2).
  9. Two lines have direction cosines (l1,m1,n1)(l_1, m_1, n_1) and (l2,m2,n2)(l_2, m_2, n_2). Show cosθ=l1l2+m1m2+n1n2\cos\theta = l_1 l_2 + m_1 m_2 + n_1 n_2.
  10. Are the lines through (1,0,0),(2,1,0)(1, 0, 0), (2, 1, 0) and through (0,0,0),(1,1,0)(0, 0, 0), (1, 1, 0) parallel?
  11. Find direction ratios for the line that is equally inclined to the coordinate axes.
  12. A line lies in the xyxy-plane and makes a 3030^\circ angle with the xx-axis. Find its direction cosines.
  13. Find μ\mu if lines with direction ratios (1,2,3)(1, 2, 3) and (1,μ,1)(-1, \mu, 1) are parallel.
  14. Find the angle between the body diagonal of a cube and one of its edges.

Pitfalls and tricks

  • l2+m2+n2=1l^2 + m^2 + n^2 = 1 for direction cosines, not for direction ratios.
  • Direction ratios are not unique , they scale.
  • For perpendicularity, the dot product of direction ratios is zero.
  • For parallelism, direction ratios are proportional (same up to scaling).
  • Angle between lines is in [0,π/2][0, \pi/2] by convention. Always take absolute value of cos\cos.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Direction cosines and ratios
6 questions · pick the best answer
Q1

Direction cosines satisfy

Q2

Direction ratios of line from (1,2,3)(1,2,3) to (4,7,5)(4,7,5)

Q3

If (2,3,4)(2, 3, 4) are direction ratios, the direction cosines are

Q4

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

Q5

Parallel condition

Q6

A line equally inclined to all 3 axes has direction cosines