Class 12 · CBSE / NCERT · Mathematics

Three Dimensional Geometry — Class 12

Every line in space has a direction you can measure with three numbers. Compute direction cosines and the angle between two lines instantly.

Direction ratios & cosinesDirection ratios (a,b,c) describe a line's direction; direction cosines (l,m,n) are the same, normalised so l²+m²+n² = 1.
Equation of a lineThrough a point (x₁,y₁,z₁) with direction ratios (a,b,c): (x−x₁)/a = (y−y₁)/b = (z−z₁)/c.
Angle between two linescosθ = (a₁a₂+b₁b₂+c₁c₂) / (√(a₁²+b₁²+c₁²)·√(a₂²+b₂²+c₂²)), using the direction ratios of each line.

Angle between two lines calculator Interactive

Enter the direction ratios of two lines to find the angle between them.

Angle θ (degrees)

If the result is 90°, the lines are perpendicular — that happens exactly when a₁a₂+b₁b₂+c₁c₂ = 0.

Solved examples

Q1. Find the direction cosines of a line with direction ratios (1, 2, 2).

Magnitude = √(1²+2²+2²) = √9 = 3

Direction cosines = (1/3, 2/3, 2/3)

Check: (1/3)² + (2/3)² + (2/3)² = 1/9+4/9+4/9 = 1 ✓

Formula sheet

QuantityFormula
Direction cosines relationl² + m² + n² = 1
Angle between two linescosθ = Σaᵢaⱼ / (|d₁||d₂|)
Perpendicular linesa₁a₂+b₁b₂+c₁c₂ = 0

Common mistakes & exam wins

  • Direction cosines are just direction ratios divided by the magnitude, so they always satisfy l²+m²+n²=1.
  • Two lines are perpendicular exactly when a₁a₂+b₁b₂+c₁c₂ = 0.
  • The equation of a line needs one point on it PLUS its direction ratios.

Frequently asked questions

What are direction cosines?

The cosines of the angles a line makes with the x, y and z axes; they satisfy l² + m² + n² = 1.

How do you find the angle between two lines in 3D?

Use cosθ = (a₁a₂+b₁b₂+c₁c₂)/(|d₁||d₂|), from the direction ratios of each line.

What is the condition for two lines to be perpendicular?

The dot product of their direction ratios is zero: a₁a₂+b₁b₂+c₁c₂ = 0.