Finding Direction Cosines

What they are

The direction cosines (l,m,n)(l, m, n) of a line are the cosines of the angles it makes with the xx-, yy- and zz-axes. Any multiples (a,b,c)(a, b, c) of them are direction ratios; divide by the magnitude to get back to cosines:

(l,m,n)=(aa2+b2+c2,ba2+b2+c2,ca2+b2+c2),l2+m2+n2=1(l,m,n) = \left(\dfrac{a}{\sqrt{a^2+b^2+c^2}}, \dfrac{b}{\sqrt{a^2+b^2+c^2}}, \dfrac{c}{\sqrt{a^2+b^2+c^2}}\right), \qquad l^2+m^2+n^2 = 1

Worked example: a coordinate axis

The xx-axis has no yy or zz component, so its direction cosines are (1,0,0)(1, 0, 0).

Worked example: a line through two points

The line joining (1,0,0)(1,0,0) and (0,1,1)(0,1,1) has direction ratios (−1,1,1)(-1, 1, 1) and magnitude 3\sqrt{3}, so its direction cosines are (−13,13,13)\left(-\dfrac{1}{\sqrt3}, \dfrac{1}{\sqrt3}, \dfrac{1}{\sqrt3}\right).

Worked example: from direction ratios

For direction ratios (2,−3,6)(2, -3, 6), the magnitude is 4+9+36=7\sqrt{4+9+36} = 7, so the direction cosines are (27,−37,67)\left(\dfrac{2}{7}, -\dfrac{3}{7}, \dfrac{6}{7}\right). Check: 4+9+3649=1\dfrac{4+9+36}{49} = 1.

Worked example: from given angles

A line makes 90∘90^\circ, 60∘60^\circ and 30∘30^\circ with the axes, so its direction cosines are (cos⁡90∘,cos⁡60∘,cos⁡30∘)=(0,12,32)(\cos 90^\circ, \cos 60^\circ, \cos 30^\circ) = \left(0, \dfrac{1}{2}, \dfrac{\sqrt3}{2}\right).

If a line makes 45∘45^\circ with the xx-axis and 60∘60^\circ with the yy-axis, the third cosine comes from the identity: n2=1−12−14=14n^2 = 1 - \dfrac{1}{2} - \dfrac{1}{4} = \dfrac{1}{4}, so n=±12n = \pm\dfrac{1}{2} and the angle with the zz-axis is 60∘60^\circ or 120∘120^\circ.

Worked example: the angle between two lines

For lines with direction cosines (27,−37,67)\left(\tfrac{2}{7}, -\tfrac{3}{7}, \tfrac{6}{7}\right) and (13,23,23)\left(\tfrac{1}{3}, \tfrac{2}{3}, \tfrac{2}{3}\right):

cos⁡θ=221−621+1221=821,θ≈67.6∘\cos\theta = \dfrac{2}{21} - \dfrac{6}{21} + \dfrac{12}{21} = \dfrac{8}{21}, \qquad \theta \approx 67.6^\circ

Direction cosines and unit vectors

The direction cosines of a line are exactly the components of a unit vector along it: li^+mj^+nk^l\hat{i} + m\hat{j} + n\hat{k} has length l2+m2+n2=1\sqrt{l^2+m^2+n^2} = 1. So finding direction cosines is the same calculation as normalising a vector, and the identity l2+m2+n2=1l^2 + m^2 + n^2 = 1 is just the statement that this vector has length 1.

Common mistakes

  • Using direction ratios as cosines. Divide by the magnitude first.
  • Accepting impossible angles. Angles of 30∘30^\circ, 45∘45^\circ and 60∘60^\circ can't all describe one line: 34+12+14=32≠1\tfrac{3}{4} + \tfrac{1}{2} + \tfrac{1}{4} = \tfrac{3}{2} \ne 1.
  • Forgetting the sign choice. (l,m,n)(l, m, n) and (−l,−m,−n)(-l, -m, -n) describe the same line in opposite directions.

Where this comes up in exams

The 2025-26 CBSE Class XII syllabus lists direction cosines and direction ratios of a line joining two points and the angle between two lines. JEE Main 2026 lists direction ratios and direction cosines and the angle between two intersecting lines, and JEE Advanced 2026 lists direction cosines and direction ratios.

Checked against CBSE Mathematics curriculum, Classes XI-XII (2025-26), JEE (Main) 2026 syllabus (NTA) and JEE (Advanced) 2026 syllabus. Syllabi can change from year to year, so confirm with the latest official notification for your exam.

Continue learning

Direction ratios are exactly what a line's equation in 3D needs.