Direction cosines and direction ratios of a line

NCERT Class 12 Mathematics Chapter 11 Section 11.2

Quick answer

The direction cosines l, m, n of a directed line are the cosines of the angles it makes with the x-, y- and z-axes, and l + m + n = 1; reversing the line changes all three signs. Direction ratios a, b, c are a nonzero triple proportional to them, and l = ±a/√(a + b + c). For the line through distinct points P(x, y, z) and Q(x, y, z) the ratios are x − x, y − y, z − z.

With your textbook

NCERT Mathematics Part II (Class 12), Chapter 11 “Three Dimensional Geometry”, Section 11.2 “Direction Cosines and Direction Ratios of a Line”, pages 377–381.

Open the official NCERT chapter (PDF, 2.1 MB, ncert.nic.in) (opens in a new tab)

Checked against the 2026-27 reprint on .

What are direction cosines?

Direction cosines of a line

From Chapter 10, recall that if a directed line L passing through the origin makes angles α, β and γ with x, y and z-axes, respectively, called direction angles, then cosine of these angles, namely, cos α, cos β and cos γ are called direction cosines of the directed line L.

NCERT Mathematics Part II (Class 12), Section 11.2, page 377

  • They are written l, m, n: l = cos α, m = cos β, n = cos γ, and l2 + m2 + n2 = 1 (page 378).
  • Reversing the direction replaces each angle by its supplement, so all three signs change.

In plain words: the direction cosines of a line are those of a vector along it, as in Chapter 10. But a line has two directions:

Note that a given line in space can be extended in two opposite directions and so it has two sets of direction cosines.

NCERT Mathematics Part II (Class 12), Section 11.2, page 378

To get one set, NCERT takes the line as a directed line. A line that does not pass through the origin has the direction cosines of the parallel line through the origin, since parallel lines have the same direction cosines (Remark, page 378).

Direction ratios

Any three numbers which are proportional to the direction cosines of a line are called the direction ratios of the line.

NCERT Mathematics Part II (Class 12), Section 11.2, page 378

If a, b, c are direction ratios, then a = λl, b = λm, c = λn for some nonzero λ, and any nonzero multiple ka, kb, kc is again a set of direction ratios: a line has infinitely many sets (pages 378–379). Some books call them direction numbers. Putting l = ak, m = bk, n = ck into l2 + m2 + n2 = 1 gives k = ±1/√(a2 + b2 + c2):

From direction ratios to direction cosines (NCERT page 379)

l = ± a/√(a + b + c), m = ± b/√(a + b + c), n = ± c/√(a + b + c)

(take the same sign in all three)

NCERT Example 2 (page 380): direction ratios 2, −1, −2 give √(4 + 1 + 4) = 3 and direction cosines 2/3, −1/3, −2/3 (or all with the opposite sign).

The line through two points

For distinct points P(x, y, z) and Q(x, y, z), the right triangles of NCERT Fig 11.2 give cos γ = (z − z)/PQ, and the same for α and β (NCERT Section 11.2.1, page 379):

Line through P(x, y, z) and Q(x, y, z)

direction cosines: (x − x)/PQ, (y − y)/PQ, (z − z)/PQ

direction ratios: x − x, y − y, z − z

Here PQ is given by the Class 11 distance formula. The direction ratios may equally be taken as x − x, y − y, z − z (NCERT’s Note, page 380). NCERT Example 3 (page 380): through (−2, 4, −5) and (1, 2, 3), the ratios are 3, −2, 8, PQ = √77, and the direction cosines are 3/√77, −2/√77, 8/√77.

Collinear points

Three distinct points A, B, C are collinear when the direction ratios of AB and BC are proportional: then AB is parallel to BC, and B is on both (NCERT Example 5, page 381, for A(2, 3, −4), B(1, −2, 3), C(3, 8, −11), with ratios −1, −5, 7 and 2, 10, −14).

Solved examples

Example 1: From the angles (NCERT Exercise 11.1, Q1, page 381)

A line makes angles 90°, 135° and 45° with the x-, y- and z-axes. Find its direction cosines.

cos 90° = 0, cos 135° = −1/√2 and cos 45° = 1/√2. Check: 0 + 1/2 + 1/2 = 1.

Answer: 0, −1/√2, 1/√2.

Example 2: From direction ratios (NCERT Exercise 11.1, Q3, page 381)

A line has direction ratios −18, 12, −4. Find its direction cosines.

√(324 + 144 + 16) = √484 = 22, so divide each ratio by 22.

Answer: −9/11, 6/11, −2/11 (or 9/11, −6/11, 2/11 for the opposite direction).

Example 3: The sides of a triangle (NCERT Exercise 11.1, Q5, page 381)

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

AB has ratios −4, −4, 6 and length √68 = 2√17. BC has ratios −4, −6, −4 and length 2√17. CA has ratios 8, 10, −2 and length √168 = 2√42.

Answer: AB: −2/√17, −2/√17, 3/√17; BC: −2/√17, −3/√17, −2/√17; CA: 4/√42, 5/√42, −1/√42.

NCERT slip (answers, page 453): the key prints the third direction cosine of AB as 3/17, without the square root. It is 3/√17: with 3/17 the squares would add up to 8/17 + 9/289, not 1. In an exam, check that the squares add up to 1.

Example 4: Three points in a line (NCERT Exercise 11.1, Q4, page 381)

Show that (2, 3, 4), (−1, −2, 1) and (5, 8, 7) are collinear.

Call them A, B, C. AB has ratios −3, −5, −3 and BC has ratios 6, 10, 6 = −2 × (−3, −5, −3).

Answer: the ratios are proportional and B is common, so the points are collinear.

Example 5: Angles from direction ratios

A line has direction ratios 1, −1, √2. Find the angles it makes with the axes.

√(1 + 1 + 2) = 2, so the direction cosines are 1/2, −1/2 and √2/2.

Answer: 60°, 120° and 45° (or their supplements, 120°, 60° and 135°, for the opposite direction).

Common mistakes to avoid

Common mistake

Using direction ratios as cosines

Ratios such as −18, 12, −4 are only proportional to the cosines; divide by √(a2 + b2 + c2) first.

Common mistake

Mixing signs

Either all three direction cosines keep their signs or all three change: 9/11, −6/11, −2/11 is not a set for the line of Example 2.

Common mistake

Collinear from one pair only

Proportional ratios for AB and CD show only that the lines are parallel. For three points, use AB and BC, which share B.

Quick revision summary

  • Direction cosines l, m, n of a directed line are the cosines of its angles with the axes; l + m + n = 1, and reversing the line changes all three signs.
  • Direction ratios are any three numbers proportional to them; l = ±a/√(a + b + c), and so on.
  • Through P and Q: ratios x − x, y − y, z − z, and cosines these divided by PQ.
  • A, B, C are collinear when AB and BC have proportional direction ratios.

Formula sheet

  • l + m + n = 1
  • l = ±a/√(a + b + c), and the same for m, n
  • through P, Q: cosines (x − x)/PQ, (y − y)/PQ, (z − z)/PQ

Questions students ask

Why do the direction cosines of a line satisfy l + m + n = 1?

The direction cosines of a line satisfy l + m + n = 1 because they are the coordinates of the point 1 unit from the origin O along the parallel directed line through O: a point P(x, y, z) on it at distance r from O, in its direction, has l = x/r, m = y/r and n = z/r, and x + y + z = r. NCERT’s 2022 list of rationalised content (page 45) dropped this proof, old Section 11.2.1, so the 2026–27 reprint only states it (page 378); direction cosines of a vector has the same argument. Two direction cosines fix the third up to sign: l = 12/25 and m = 16/25 leave n = 9/25, so n = ±3/5.

Is the sum of the direction cosines of a line equal to 1?

No, the sum of the direction cosines of a line, l + m + n, is not fixed; it is the sum of their squares, l + m + n, that equals 1. For direction cosines 6/11, 6/11 and 7/11 the squares add up to (36 + 36 + 49)/121 = 1, but the cosines themselves add up to 19/11, and the same line taken the other way has −6/11, −6/11 and −7/11, with sum −19/11. The sum always lies between −√3 and √3, because the square of a sum of three numbers is at most three times the sum of their squares.

Can a direction ratio of a line be zero?

Yes, one or two direction ratios of a line can be zero, but not all three: a zero direction ratio means the line makes 90° with that axis. Direction ratios 3, 0, −4 give direction cosines 3/5, 0, −4/5 (or all three negated), for a line whose direction is perpendicular to the y-axis, while 0, 0, 5 give 0, 0, 1 (or 0, 0, −1), for a line parallel to the z-axis; NCERT Example 4 (page 381) finds 1, 0, 0 for the x-axis itself. All three cannot be 0, since direction ratios are a non-zero multiple of l, m, n; in a Cartesian equation a zero ratio shows up as a zero denominator.

What is in the three dimensional geometry syllabus for Class 12 and JEE Main 2027?

The JEE Main 2027 syllabus, Unit 11, lists “Coordinates of a point in space, the distance between two points, section formula, direction ratios and direction cosines and the angle between two intersecting lines. Equation of a line; Skew lines, the shortest distance between them and its equation”. Planes are not in this list, nor in the 2026–27 NCERT Class 12 chapter, whose Sections 11.2–11.5 cover direction cosines and ratios, the line, angles between lines and the shortest distance: NCERT’s 2022 list of rationalised content (page 45) dropped Section 11.6, Plane. Coordinates and distance are Class 11 topics.

Practice questions

Try each question first, then open the answer to check your working.

  1. Q1. Find the direction cosines of a line which makes equal angles with the coordinate axes (NCERT Exercise 11.1, Q2, page 381).

    Show answerHide answer

    l = m = n and 3l2 = 1, so the direction cosines are ±(1/√3, 1/√3, 1/√3), the same answer as for a vector equally inclined to the axes.

  2. Q2. Find the direction cosines of the line through (1, 0, −2) and (5, −1, 6).

    Show answerHide answer

    The ratios are 4, −1, 8 and PQ = √(16 + 1 + 64) = 9, so the direction cosines are 4/9, −1/9, 8/9.

  3. Q3. A line has direction ratios 4, 4, −7. Find its direction cosines.

    Show answerHide answer

    √(16 + 16 + 49) = 9, so they are 4/9, 4/9, −7/9 (or all three negated).

  4. Q4. Can a line make 45° with each of the three axes?

    Show answerHide answer

    No: cos2 45° taken three times is 3/2, not 1.

More practice questions

Sources and review

Written by
TopicLamp Editorial Team.
Checked by
TopicLamp Review Team.
NCERT source
NCERT, Mathematics Part II (Class 12), reprint 2026-27. Chapter 11 “Three Dimensional Geometry”, Section 11.2 “Direction Cosines and Direction Ratios of a Line”, pages 377–381. Checked on . Official chapter PDF on ncert.nic.in (opens in a new tab) (2.1 MB).
Dates
First published Checked and updated
Corrections
  • : OpenAI Codex review: checked all line/direction examples, FAQs and practice; independently solved feet and distances. Corrected reversed angles and degenerate-direction conditions; retained two sound lessons unchanged.

Report a mistake on this page How pages are written, reviewed and corrected

Topics in Three Dimensional Geometry

  1. Direction cosines and direction ratios of a line

    NCERT Section 11.2 You are reading this topic

  2. Equation of a line in space: vector and Cartesian forms

    NCERT Section 11.3 11 min read

  3. Angle between two lines in space

    NCERT Section 11.4 11 min read

  4. Shortest distance between two lines: skew and parallel lines

    NCERT Section 11.5 12 min read

  5. Line of shortest distance between two skew lines

    9 min read