Skip to content
Helper

3D Geometry Class 12: Lines in Space, Explained with Solved Problems

Lines in space: direction cosines, equations, angles and shortest distance

Class 128 solved problems Checked 23 Nov

3d geometry class 12 is the study of lines in space using coordinates and vectors: you find the direction of a line with direction cosines, write its equation in vector or cartesian form, and measure the angle and the shortest distance between two lines. Two formulas carry most of the marks, cos θ for the angle and the cross product formula for the shortest distance.

Below, each idea comes in the same sequence as your chapter, followed by eight problems laid out the way a board answer should look. After them you get four self-test questions with the answers folded away, plus the slips examiners keep marking wrong.

Wire cube model with three dowels showing the axes used in 3d geometry class 12
Three edges meeting at a corner act like the x, y and z axes.

At a glance

  • Chapter

    11, Three Dimensional Geometry
  • Exercises

    11.1, 11.2 and Miscellaneous
  • Direction cosines

    l2 + m2 + n2 = 1
  • Line (vector form)

    r = a + λb
  • Perpendicular lines

    a1a2 + b1b2 + c1c2 = 0
  • Skew lines

    Not parallel and never meet

What 3D geometry class 12 covers in the current book

In the current NCERT book, Three Dimensional Geometry is Chapter 11, which sits in the second volume. Its work is split into Exercise 11.1, Exercise 11.2 and one mixed set at the end. The first exercise is about direction cosines and direction ratios of a line. The second deals with the equation of a line in space, the angle between two lines and the shortest distance between two lines. The Miscellaneous Exercise on Chapter 11 mixes all of these.

The chapter builds directly on the class 11 chapter that introduced points in space and the distance formula, and on vector algebra class 12, which gives you the dot and cross products used here. If vectors feel shaky, revise them first. Almost every answer in this chapter is a dot product or a cross product in disguise.

This site is not affiliated with NCERT; this is an independent explanation.

Direction cosines and direction ratios

Suppose a line makes angles α, β and γ with the positive x, y and z axes. The cosines of these angles are the direction cosines of the line. We write them as l, m and n.

l = cos α, m = cos β, n = cos γ
l2 + m2 + n2 = 1

Any three numbers a, b, c in the same proportion as l, m, n are called direction ratios. A line has one set of direction cosines (up to sign) but endless direction ratios, because 2, -1, 2 and 4, -2, 4 point the same way. To turn ratios into cosines, divide each by √(a2 + b2 + c2).

l = a/√(a2 + b2 + c2), and similarly for m and n

For the line through two points P(x1, y1, z1) and Q(x2, y2, z2), the direction ratios are simply the differences x2 - x1, y2 - y1 and z2 - z1.

Equation of a line in space: vector and cartesian forms

A line is fixed once you know one point on it and its direction. If the point has position vector a and the line is parallel to vector b, every point on the line has position vector

r = a + λb, where λ is any real number

Write a = x1i + y1j + z1k and b = a i + b j + c k. Compare the components and remove λ. You get the cartesian form.

(x - x1)/a = (y - y1)/b = (z - z1)/c

For a line through two points with position vectors a and c, use b = c - a. Students lose marks when they write (x + 1) for a point with x1 = 1. Keep the sign rule simple: the cartesian form always shows x minus the coordinate.

Angle between two lines and the shortest distance

The angle between two lines is the angle between their direction vectors b1 and b2. Take the modulus of the dot product so the angle comes out acute.

cos θ = |b1 · b2| / (|b1| |b2|)

In cartesian terms with direction ratios a1, b1, c1 and a2, b2, c2, the lines are perpendicular when a1a2 + b1b2 + c1c2 = 0 and parallel when the ratios are proportional.

In a plane, two lines either meet or are parallel. In space there is a third case: skew lines, which never meet and are not parallel, like a road on a bridge and a railway line passing under it at an angle. The shortest distance is measured along the segment perpendicular to both.

Skew lines: d = |(b1 × b2) · (a2 - a1)| / |b1 × b2|
Parallel lines: d = |b × (a2 - a1)| / |b|

If the skew formula gives d = 0, the lines actually intersect. That is a quick test for whether two lines meet.

Worked problems on 3d geometry class 12

All eight are our own questions, built on the pattern of Exercises 11.1 and 11.2, and each one is solved in full. Copy the layout: formula first, then substitution, then the answer.

Example 1. Find the direction cosines of a line whose direction ratios are 2, -1, 2.

  1. √(22 + (-1)2 + 22) = √9 = 3
  2. l = 2/3, m = -1/3, n = 2/3
  3. Check: 4/9 + 1/9 + 4/9 = 1

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

  1. Direction ratios: 4 - 1 = 3, 6 - 2 = 4, 9 - (-3) = 12
  2. PQ = √(9 + 16 + 144) = √169 = 13
  3. Direction cosines: 3/13, 4/13, 12/13

Example 3. Show that A(2, 3, 4), B(4, 7, 10) and C(5, 9, 13) are collinear.

  1. Direction ratios of AB: 2, 4, 6
  2. Direction ratios of BC: 1, 2, 3
  3. 2/1 = 4/2 = 6/3 = 2, so AB and BC are parallel
  4. They share the point B, so A, B and C lie on one line

Example 4. Find the vector and cartesian equations of the line through (1, -2, 3) parallel to 2i + j - 2k.

  1. a = i - 2j + 3k, b = 2i + j - 2k
  2. Vector form: r = (i - 2j + 3k) + λ(2i + j - 2k)
  3. Cartesian form: (x - 1)/2 = (y + 2)/1 = (z - 3)/(-2)

Example 5. Two lines have direction ratios 1, 1, 0 and 1, 0, 1. What angle do they make?

  1. Dot product: 1 × 1 + 1 × 0 + 0 × 1 = 1
  2. Magnitudes: √2 and √2, product 2
  3. cos θ = 1/2, so θ = 60°

Quick variation: for ratios 1, 2, 2 and 2, -2, 1 the dot product is 2 - 4 + 2 = 0, so those lines are perpendicular.

Example 6. Find the shortest distance between r = (i + j) + λ(2i - j + k) and r = (2i + j - k) + μ(3i - 5j + 2k).

  1. a2 - a1 = i + 0j - k
  2. b1 × b2 = 3i - j - 7k (expand the 3 by 3 determinant)
  3. |b1 × b2| = √(9 + 1 + 49) = √59
  4. (3i - j - 7k) · (i - k) = 3 + 7 = 10
  5. d = 10/√59 units, roughly 1.30 units when rounded to two places

Example 7. Find the distance between the parallel lines r = (i + 2k) + λ(i + 2j + 2k) and r = (3i + j + k) + μ(i + 2j + 2k).

  1. a2 - a1 = 2i + j - k
  2. b × (a2 - a1) = -4i + 5j - 3k
  3. Its magnitude: √(16 + 25 + 9) = √50 = 5√2
  4. |b| = √(1 + 4 + 4) = 3
  5. d = 5√2/3 units, about 2.36 units

Example 8. Write the cartesian equation of the line through (2, -1, 3) and (5, 1, -1).

  1. Direction ratios: 5 - 2 = 3, 1 - (-1) = 2, -1 - 3 = -4
  2. Answer: (x - 2)/3 = (y + 1)/2 = (z - 3)/(-4)

Try these yourself

Work each one in your notebook before opening the answer.

  1. Direction ratios of a line are 6, 2, 3. Find its direction cosines.
    Show answer

    √(36 + 4 + 9) = √49 = 7, so the direction cosines are 6/7, 2/7, 3/7.

  2. One line has direction ratios 2, 2, 1 and another has 4, 1, 8. How big is the angle between them?
    Show answer

    Dot product = 8 + 2 + 8 = 18. Magnitudes are 3 and 9. cos θ = 18/27 = 2/3, so θ = cos-1(2/3).

  3. For what value of k are lines with ratios 1, k, 2 and 3, 1, -2 perpendicular?
    Show answer

    3 + k - 4 = 0, so k = 1.

  4. A line makes angles 90°, 60° and 30° with the x, y and z axes. Write its direction cosines.
    Show answer

    cos 90° = 0, cos 60° = 1/2, cos 30° = √3/2. Check: 0 + 1/4 + 3/4 = 1.

Common mistakes in this chapter

  • Mixing ratios and cosines. Direction cosines must satisfy l2 + m2 + n2 = 1. Ratios need not. If the question says cosines, divide by the magnitude.
  • Wrong sign in the cartesian form. A point (1, -2, 3) gives (y + 2), not (y - 2).
  • Cross product slips. The middle term of a 3 by 3 determinant carries a minus sign. Expand slowly and check one component by a dot product: b1 × b2 must be perpendicular to b1.
  • Forgetting the modulus. A distance can never be negative, so keep the absolute value bars.
  • Using the skew formula for parallel lines. If the direction vectors are proportional, the cross product is zero and the formula divides by zero. Switch to the parallel lines formula.

Exam focus for board papers

Three dimensional geometry usually appears as one or two short questions on direction cosines or the angle between lines, and one longer question on the shortest distance or on finding a line through given conditions. The long question rewards neat layout: state a1, a2, b1, b2 on separate lines, show the determinant for the cross product, then substitute. Examiners give step marks for each of these lines even if the arithmetic at the end slips.

Practise converting between vector and cartesian forms in both directions, because questions often give one form and the formula you know needs the other. Keep the chapter next to the other class 12 maths chapters in your revision plan, and use the geometry and mensuration notes to refresh solid shapes if the space picture feels hard.

Studying from an older printing?

Chapter 11 carried the same title, Three Dimensional Geometry, before the rationalised book. Older printings went further and included the plane: its equation in normal form, the plane through three points, the angle between two planes, and how far a given point lies from a plane. The current chapter stops at lines. Compare the exercise list printed in your copy to see which version your school follows, and study planes only if your syllabus lists them.

For the flat version of these ideas, the coordinate geometry page covers distance and section formulas in two dimensions, and 3D shapes helps you picture objects in space.

Frequently asked questions

What is the difference between direction cosines and direction ratios?

Direction cosines are the cosines of the angles a line makes with the three axes, and their squares add to 1. Direction ratios are any three numbers proportional to them. You get the cosines by dividing the ratios by the square root of the sum of their squares.

Which chapter is 3D geometry in class 12?

It is Chapter 11, Three Dimensional Geometry, in the second volume of the current class 12 set. It has Exercise 11.1, Exercise 11.2 and a miscellaneous exercise. Older printings were longer, so compare with the contents list in your copy.

What are skew lines?

Skew lines are lines in space that are not parallel and do not meet. They can only exist in three dimensions. The shortest distance between them is along the line segment that is perpendicular to both.

How do I know if two lines intersect?

Work out the shortest distance with the skew lines formula. If it comes to zero and the lines are not parallel, they intersect. You can then find the meeting point by equating the general points of both lines.

Are planes part of 3d geometry class 12?

The current rationalised chapter covers lines only. Older editions also taught the equation of a plane and the angle between planes. Your school syllabus decides whether planes are tested.

Why does the angle formula use a modulus?

Two lines make two angles that add up to 180°. Taking the modulus of the dot product picks the acute one, which is the standard answer for the angle between lines.