Class 12 Mathematics · Chapter 11 · Part II

Three Dimensional Geometry

Direction cosines and ratios, equations of a line, angle between lines and shortest distance.

NCERT Mathematics (Part I and Part II)CBSE Class 12 8 min read

1. Chapter at a Glance

An aircraft flies along a straight path in the sky; a drone must keep a safe distance from it. How do we describe that path, find the angle between two flight paths, or the shortest distance between them? With vectors and coordinates in space. This chapter describes lines in three dimensions by their direction cosines and ratios, writes their equations in vector and Cartesian form, and finds the angle between two lines and the shortest distance between skew lines.

What you will learn
  • Direction cosines and direction ratios of a line.
  • Direction ratios of the line through two points.
  • Equation of a line: through a point with given direction; through two points (vector and Cartesian forms).
  • Angle between two lines; perpendicular and parallel lines.
  • Skew lines and the shortest distance between two lines (skew and parallel).

2. Direction Cosines and Ratios

If a line makes angles α, β, γ with the positive x, y, z axes, its direction cosines are l = cos α, m = cos β, n = cos γ, with l² + m² + n² = 1. Any numbers a, b, c proportional to l, m, n are direction ratios:

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

Line through P(x₁, y₁, z₁) and Q(x₂, y₂, z₂): direction ratios x₂ − x₁, y₂ − y₁, z₂ − z₁.

Worked Example 1

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

Solution: DRs 3, −2, 8; √(9 + 4 + 64) = √77. DCs 3/√77, −2/√77, 8/√77.

Worked Example 2 — Collinearity

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

Solution: DRs of AB: −3, −5, −3; of BC: 6, 10, 6 = −2 × (−3, −5, −3). Proportional and sharing B → collinear.

3. Equation of a Line

GivenVector formCartesian form
Point a⃗ (x₁, y₁, z₁), direction b⃗ (a, b, c)r⃗ = a⃗ + λb⃗(x − x₁)/a = (y − y₁)/b = (z − z₁)/c
Two points a⃗, b⃗r⃗ = a⃗ + λ(b⃗ − a⃗)(x − x₁)/(x₂ − x₁) = (y − y₁)/(y₂ − y₁) = (z − z₁)/(z₂ − z₁)
O AP a⃗r⃗ = a⃗ + λb⃗b⃗
Every point P on the line is reached from A by moving λ times the direction vector b⃗.
Worked Example 3

Find the line through (5, 2, −4) parallel to 3î + 2ĵ − 8k̂, in both forms.

Solution: r⃗ = 5î + 2ĵ − 4k̂ + λ(3î + 2ĵ − 8k̂); (x − 5)/3 = (y − 2)/2 = (z + 4)/(−8).

4. Angle Between Two Lines

Formula

For lines with direction ratios (a₁, b₁, c₁) and (a₂, b₂, c₂):

cos θ = |a₁a₂ + b₁b₂ + c₁c₂| / [√(a₁² + b₁² + c₁²) √(a₂² + b₂² + c₂²)]
  • Perpendicular ⇔ a₁a₂ + b₁b₂ + c₁c₂ = 0.
  • Parallel ⇔ a₁/a₂ = b₁/b₂ = c₁/c₂.
Worked Example 4

Find the angle between (x + 3)/3 = (y − 1)/5 = (z + 3)/4 and (x + 1)/1 = (y − 4)/1 = (z − 5)/2.

Solution: cos θ = |3 + 5 + 8|/(√50 √6) = 16/√300 = 16/(10√3) = 8√3/15 → θ = cos⁻¹(8√3/15).

5. Shortest Distance Between Two Lines

Lines in space can intersect, be parallel, or be skew (neither parallel nor intersecting — like a flyover road and the road below it). The shortest distance is along the common perpendicular.

Formulas

Skew lines r⃗ = a⃗₁ + λb⃗₁ and r⃗ = a⃗₂ + μb⃗₂:

d = |(b⃗₁ × b⃗₂) · (a⃗₂ − a⃗₁)| / |b⃗₁ × b⃗₂|

Parallel lines r⃗ = a⃗₁ + λb⃗ and r⃗ = a⃗₂ + μb⃗:

d = |b⃗ × (a⃗₂ − a⃗₁)| / |b⃗|

If d = 0 for non-parallel lines, they intersect.

Worked Example 5

Find the shortest distance between r⃗ = î + ĵ + λ(2î − ĵ + k̂) and r⃗ = 2î + ĵ − k̂ + μ(3î − 5ĵ + 2k̂).

Solution: b⃗₁ × b⃗₂ = î(−2 + 5) − ĵ(4 − 3) + k̂(−10 + 3) = 3î − ĵ − 7k̂, magnitude √59. a⃗₂ − a⃗₁ = î − k̂. Dot = 3 + 7 = 10. d = 10/√59.

Worked Example 6 — Parallel lines

Find the distance between r⃗ = î + 2ĵ − 4k̂ + λ(2î + 3ĵ + 6k̂) and r⃗ = 3î + 3ĵ − 5k̂ + μ(2î + 3ĵ + 6k̂).

Solution: a⃗₂ − a⃗₁ = 2î + ĵ − k̂. b⃗ × (a⃗₂ − a⃗₁) = î(−3 − 6) − ĵ(−2 − 12) + k̂(2 − 6) = −9î + 14ĵ − 4k̂, magnitude √293. |b⃗| = 7. d = √293/7.

6. Solved Problems (Board Pattern)

Problem 1 — Perpendicular lines

Find k so that (x − 1)/(−3) = (y − 2)/(2k) = (z − 3)/2 and (x − 1)/(3k) = (y − 1)/1 = (z − 6)/(−5) are perpendicular.

Solution: −9k + 2k − 10 = 0 → k = −10/7.

Problem 2 — Through two points

Find the vector and Cartesian equations of the line through (3, −2, −5) and (3, −2, 6).

Solution: Direction 0î + 0ĵ + 11k̂. r⃗ = 3î − 2ĵ − 5k̂ + λ(11k̂); Cartesian: x = 3, y = −2 (the line is parallel to the z-axis).

Problem 3 — Do the lines intersect?

Find the shortest distance between (x + 1)/7 = (y + 1)/(−6) = (z + 1)/1 and (x − 3)/1 = (y − 5)/(−2) = (z − 7)/1.

Solution: b⃗₁ × b⃗₂ = î(−6 + 2) − ĵ(7 − 1) + k̂(−14 + 6) = −4î − 6ĵ − 8k̂, magnitude √116 = 2√29. a⃗₂ − a⃗₁ = 4î + 6ĵ + 8k̂. Dot = −16 − 36 − 64 = −116. d = 116/(2√29) = 2√29.

7. Master Formula Table

ResultFormula
Direction cosinesl² + m² + n² = 1
DCs from DRsa/√(a² + b² + c²), …
Line (point, direction)r⃗ = a⃗ + λb⃗; (x − x₁)/a = (y − y₁)/b = (z − z₁)/c
Line (two points)r⃗ = a⃗ + λ(b⃗ − a⃗)
Anglecos θ = |b⃗₁·b⃗₂|/(|b⃗₁||b⃗₂|)
Skew lines|(b⃗₁ × b⃗₂)·(a⃗₂ − a⃗₁)|/|b⃗₁ × b⃗₂|
Parallel lines|b⃗ × (a⃗₂ − a⃗₁)|/|b⃗|

8. Master Summary Table

Pair of linesTestShortest distance
ParallelProportional DRs|b⃗ × (a⃗₂ − a⃗₁)|/|b⃗|
IntersectingNot parallel, d = 00
SkewNot parallel, d ≠ 0Triple-product formula
PerpendicularΣa₁a₂ = 0—

9. Mind Map

3-D Geometry (Lines)
Direction
  • DCs, DRs
  • l² + m² + n² = 1
Equations
  • a⃗ + λb⃗
  • Symmetric form
Angle
  • cos θ formula
  • ⊥ and ∥ tests
Distance
  • Skew lines
  • Parallel lines

10. Tips and Tricks

Smart ideas
  • Before using the line formulas, rewrite each equation so the coefficients of x, y, z are 1: (2x − 1)/4 → (x − ½)/2.
  • Read the point from the numerators (with signs flipped) and the direction from the denominators.
  • If the shortest distance comes out 0, the lines intersect.
Common mistakes
  • Taking (x + 3)/2 as passing through (3, …) — it passes through (−3, …).
  • Using the skew-lines formula for parallel lines (b⃗₁ × b⃗₂ = 0⃗).
  • Forgetting the absolute value in cos θ (we want the acute angle).

11. Important One-liners

  • Direction cosines of the x-axis are 1, 0, 0.
  • Skew lines are neither parallel nor intersecting.
  • Two lines are perpendicular iff a₁a₂ + b₁b₂ + c₁c₂ = 0.
  • The shortest distance between skew lines lies along their common perpendicular.
  • A line is fixed by a point and a direction.

12. Exam-pattern Questions with Detailed Answers

Q1Easy

The direction cosines of the y-axis are:

  1. 1, 0, 0
  2. 0, 1, 0
  3. 0, 0, 1
  4. 1, 1, 1
Show answer

It makes 90°, 0°, 90° with the axes.

Answer: (B)

Q2Easy

If a line makes angles 90°, 135°, 45° with the axes, find its direction cosines.

Show answer

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

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

Q3Easy

Write the Cartesian equation of the line r⃗ = (2î − ĵ + 4k̂) + λ(î + ĵ − 2k̂).

Show answer

(x − 2)/1 = (y + 1)/1 = (z − 4)/(−2).

Answer: (x − 2)/1 = (y + 1)/1 = (z − 4)/(−2)

Q4Medium

Show that the lines (x − 5)/7 = (y + 2)/(−5) = z/1 and x/1 = y/2 = z/3 are perpendicular.

Show answer

7 − 10 + 3 = 0 ✓.

Answer: Proved

Q5Medium

Find the angle between the lines r⃗ = 3î + 2ĵ − 4k̂ + λ(î + 2ĵ + 2k̂) and r⃗ = 5î − 2ĵ + μ(3î + 2ĵ + 6k̂).

Show answer

cos θ = (3 + 4 + 12)/(3 × 7) = 19/21 → θ = cos⁻¹(19/21).

Answer: cos⁻¹(19/21)

Q6Medium

Find the equation of the line through (1, 2, 3) parallel to the line (x − 4)/2 = (y + 1)/(−3) = (z − 7)/6.

Show answer

(x − 1)/2 = (y − 2)/(−3) = (z − 3)/6.

Answer: (x − 1)/2 = (y − 2)/(−3) = (z − 3)/6

Q7Medium

Find the direction cosines of the line (x − 2)/2 = (2y − 5)/(−3) = (z + 1)/(−1).

Show answer

(2y − 5)/(−3) = (y − 5/2)/(−3/2). DRs 2, −3/2, −1 → 4, −3, −2; √29. DCs 4/√29, −3/√29, −2/√29.

Answer: 4/√29, −3/√29, −2/√29

Q8Medium

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

Show answer

DRs AB: 2, 2, 4; AC: −4, −4, −8 = −2 × AB. Collinear.

Answer: Proved

Q9Hard

Find the shortest distance between r⃗ = (î + 2ĵ + k̂) + λ(î − ĵ + k̂) and r⃗ = 2î − ĵ − k̂ + μ(2î + ĵ + 2k̂).

Show answer

b⃗₁ × b⃗₂ = î(−2 − 1) − ĵ(2 − 2) + k̂(1 + 2) = −3î + 3k̂, magnitude 3√2. a⃗₂ − a⃗₁ = î − 3ĵ − 2k̂. Dot = −3 − 6 = −9. d = 9/(3√2) = 3/√2.

Answer: 3/√2

Q10Hard

Show that the lines (x − 1)/2 = (y − 2)/3 = (z − 3)/4 and (x − 4)/5 = (y − 1)/2 = z/1 intersect.

Show answer

b⃗₁ × b⃗₂ = î(3 − 8) − ĵ(2 − 20) + k̂(4 − 15) = −5î + 18ĵ − 11k̂. a⃗₂ − a⃗₁ = 3î − ĵ − 3k̂. Dot = −15 − 18 + 33 = 0 → shortest distance 0, and they are not parallel → they intersect.

Answer: Proved (they meet at (−1, −1, −1))

Q11Hard

Find the shortest distance between the parallel lines r⃗ = î + ĵ + λ(2î − ĵ + k̂) and r⃗ = 2î + ĵ − k̂ + μ(4î − 2ĵ + 2k̂).

Show answer

Take b⃗ = 2î − ĵ + k̂ (|b⃗| = √6). a⃗₂ − a⃗₁ = î − k̂. b⃗ × (î − k̂) = î(1 − 0) − ĵ(−2 − 1) + k̂(0 + 1) = î + 3ĵ + k̂, magnitude √11. d = √11/√6.

Answer: √(11/6)

Q12Hard

Find the vector equation of the line through (1, 2, −4) perpendicular to both (x − 8)/3 = (y + 19)/(−16) = (z − 10)/7 and (x − 15)/3 = (y − 29)/8 = (z − 5)/(−5).

Show answer

Direction = (3, −16, 7) × (3, 8, −5) = î(80 − 56) − ĵ(−15 − 21) + k̂(24 + 48) = 24î + 36ĵ + 72k̂ ∥ 2î + 3ĵ + 6k̂. r⃗ = î + 2ĵ − 4k̂ + λ(2î + 3ĵ + 6k̂).

Answer: r⃗ = î + 2ĵ − 4k̂ + λ(2î + 3ĵ + 6k̂)

13. Quick Revision Summary

Revise in 2 minutes
  • DCs: l² + m² + n² = 1; DRs proportional; through two points: differences.
  • Line: r⃗ = a⃗ + λb⃗ ⇔ (x − x₁)/a = (y − y₁)/b = (z − z₁)/c.
  • Angle: cos θ = |b⃗₁·b⃗₂|/(|b⃗₁||b⃗₂|); ⊥ if dot = 0; ∥ if DRs proportional.
  • Skew lines: d = |(b⃗₁ × b⃗₂)·(a⃗₂ − a⃗₁)|/|b⃗₁ × b⃗₂|.
  • Parallel lines: d = |b⃗ × (a⃗₂ − a⃗₁)|/|b⃗|.