NDA Maths · 3D Geometry

Direction Cosines & Direction Ratios

The numbers that capture a line's direction in space — direction cosines are the unit version (squaring to 1), direction ratios are any proportional set.

Why this matters

Twenty-four PYQs across 2017–2026 — the engine room of the chapter. Almost every line, plane, and angle question reduces to direction cosines and ratios. The identity l² + m² + n² = 1 and the angle-between-lines formula together unlock the bulk of the bank. Difficulty here runs a touch higher (25% HARD), so the seven concepts below earn their keep.

Concept 1 of 7

Direction ratios, direction cosines, and the unit identity

Intuition

A line's direction can be described by any vector along it — those components are its DIRECTION RATIOS, and there are infinitely many proportional sets. Normalise that vector to unit length and the components become the DIRECTION COSINES l,m,n\langle l, m, n\rangle — the cosines of the angles the line makes with the three axes. Because they're a unit vector's components, they always satisfy l2+m2+n2=1l^2 + m^2 + n^2 = 1.

Definition

If a line has direction ratios a,b,c\langle a, b, c\rangle, its direction cosines are obtained by dividing by the magnitude: l=a/a2+b2+c2l = a/\sqrt{a^2+b^2+c^2}, and similarly for m,nm, n. They are the cosines of the angles α,β,γ\alpha, \beta, \gamma the line makes with the positive xx-, yy-, zz-axes. The defining identity is below.

Direction cosines square-sum to 1

l2+m2+n2=1,l=cosα, m=cosβ, n=cosγl^2 + m^2 + n^2 = 1, \quad l = \cos\alpha,\ m = \cos\beta,\ n = \cos\gamma
  • l,m,nl,m,ndirection cosines
  • α,β,γ\alpha,\beta,\gammaangles with the x, y, z axes

Diagram · direction cosines (drag to rotate)

xyzr
α ≈ 49° · l = 0.66β ≈ 62° · m = 0.48γ ≈ 54° · n = 0.58

l, m, n are the cosines of the angles r makes with the x-, y-, z-axes — and the components of the unit vector along r. So l² + m² + n² = 1.00 = 1, always.

Worked example

Find the direction cosines of the line with direction ratios 2,1,2\langle 2, -1, 2\rangle.
  1. Magnitude: 22+(1)2+22=4+1+4=9=3\sqrt{2^2 + (-1)^2 + 2^2} = \sqrt{4+1+4} = \sqrt{9} = 3.
  2. Divide each ratio by 3: l=23, m=13, n=23l = \tfrac{2}{3},\ m = -\tfrac{1}{3},\ n = \tfrac{2}{3}.
  3. Check: 49+19+49=99=1\tfrac{4}{9} + \tfrac{1}{9} + \tfrac{4}{9} = \tfrac{9}{9} = 1. ✓
Answer:23,13,23\left\langle \tfrac{2}{3}, -\tfrac{1}{3}, \tfrac{2}{3} \right\rangle.
Practice this conceptself-check · 4 quick reps

Try it yourself

A line has direction ratios a+b, b+c, c+a\langle a+b,\ b+c,\ c+a\rangle. What is the sum of the squares of its direction cosines?

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    Sum of squares of any line's direction cosines?
  2. 2.
    Direction cosines of DRs 1,2,2\langle 1, 2, 2\rangle?
  3. 3.
    Can 0,4,0\langle 0, 4, 0\rangle be direction ratios of the y-axis?
  4. 4.
    If l=m=nl = m = n, find ll (positive).

From the bank · past-year question

Example 13D GeometryEASY
If a line has direction ratios a+b,b+c,c+a\langle a+b, b+c, c+a\rangle, then what is the sum of the squares of its direction cosines?

[Q63 · Apr · 2020]

Direction RATIOS are not unique; direction COSINES (almost) are

2,1,2\langle 2,-1,2\rangle and 4,2,4\langle 4,-2,4\rangle are the same direction. Only after normalising do you get direction cosines — and even then a line has TWO sets (±\pm) for its two orientations. Sum of squares of ratios is NOT 1; only the cosines satisfy that.

Concept 2 of 7

Direction cosines of the axes and special lines

Intuition

The axes themselves are the simplest directions. The x-axis points purely along xx, so its direction cosines are 1,0,0\langle 1, 0, 0\rangle — and a line perpendicular to an axis has a 0 in that slot. Memorise this tiny table and the recall questions become instant.

Definition

A line parallel to an axis has that axis's direction cosines; a line perpendicular to an axis has a zero in the corresponding component. A line in (or parallel to) the XY-plane is perpendicular to the z-axis, so n=0n = 0.

LineDirection cosinesNote
x-axis1,0,0\langle 1, 0, 0 \ranglemakes 0° with x, 90° with y and z
y-axis0,1,0\langle 0, 1, 0 \rangleDCs 0,1,0\langle 0,1,0\rangle; DRs e.g. 0,4,0\langle 0,4,0\rangle
z-axis0,0,1\langle 0, 0, 1 \rangleperpendicular to the whole XY-plane
⊥ to z-axisn=0n = 0, e.g. 5,6,0\langle 5, 6, 0\ranglelies in / parallel to the XY-plane
A line perpendicular to the z-axis just needs its z-component zero — the x, y parts are free.
Parallel to an axis → that axis's DCs. Perpendicular to an axis → a zero in that slot.
Practice this conceptself-check · 4 quick reps

Try it yourself

What are the direction cosines of the z-axis, and what angle does it make with the x-axis?

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    Direction cosines of the x-axis?
  2. 2.
    A line with DCs 0,1,0\langle 0,1,0\rangle is which axis?
  3. 3.
    DRs of a line perpendicular to the z-axis must have which component zero?
  4. 4.
    Angle the y-axis makes with the z-axis?

From the bank · past-year question

Example 23D GeometryEASY
What are the direction cosines of z-axis?

[Q65 · Apr · 2019]

Concept 3 of 7

Reading direction ratios off a line

Intuition

When a line is given in symmetric form xx0a=yy0b=zz0c\frac{x-x_0}{a} = \frac{y-y_0}{b} = \frac{z-z_0}{c}, the denominators a,b,c\langle a, b, c\rangle ARE the direction ratios. The catch: the form must have coefficient 1 on each variable in the numerator — rewrite things like 2(y+3)2(y+3) or 1z1 - z first, watching the sign.

Definition

Put the line into true symmetric form (each numerator xx0x - x_0, coefficient 1). The denominators are the direction ratios. A coordinates-of-a-point form (x0+at, y0+bt, z0+ct)(x_0 + at,\ y_0 + bt,\ z_0 + ct) gives direction ratios a,b,c\langle a, b, c\rangle directly (the coefficients of the parameter). Normalise to get direction cosines.

Worked example

Find the direction cosines of the line x1=2(y+3)=1zx - 1 = 2(y+3) = 1 - z.
  1. Rewrite each piece as varconstcoeff\frac{\text{var} - \text{const}}{\text{coeff}}: set each equal to tt.
  2. x1=tx - 1 = t; 2(y+3)=ty+31/2=t2(y+3) = t \Rightarrow \frac{y+3}{1/2} = t; 1z=tz11=t1 - z = t \Rightarrow \frac{z-1}{-1} = t.
  3. Direction ratios: 1, 12, 1\left\langle 1,\ \tfrac12,\ -1 \right\rangle, or clearing fractions 2,1,2\langle 2, 1, -2\rangle.
  4. Magnitude 4+1+4=3\sqrt{4+1+4} = 3 → direction cosines 23,13,23\left\langle \tfrac23, \tfrac13, -\tfrac23\right\rangle.
Answer:23,13,23\left\langle \tfrac23, \tfrac13, -\tfrac23 \right\rangle.
Practice this conceptself-check · 4 quick reps

Try it yourself

A line is given in parametric form as (2+t, 12t, 3+2t)(2 + t,\ 1 - 2t,\ 3 + 2t). Find its direction cosines.

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    DRs of x13=y4=z+25\frac{x-1}{3} = \frac{y}{4} = \frac{z+2}{5}?
  2. 2.
    DRs from point (2+3t,1t,4t)(2+3t, 1-t, 4t)?
  3. 3.
    Rewrite 1z=t1 - z = t as a denominator form: coefficient of z?
  4. 4.
    DCs of DRs 0,3,4\langle 0, 3, 4\rangle?

From the bank · past-year question

Example 33D GeometryMODERATE
A point on a line has coordinates (p+1,p3,2p)(p+1,\, p-3,\, \sqrt{2}p) where pp is any real number. What are the direction cosines of the line ?

[Q56 · Sep · 2019]

Mind the coefficient and the sign before reading denominators

2(y+3)2(y+3) is NOT denominator 2 — it's y+31/2\frac{y+3}{1/2}, so the ratio component is 12\tfrac12. And 1z1 - z flips the sign: z11\frac{z-1}{-1}. Read symmetric form only after each variable has coefficient +1+1.

Concept 4 of 7

Angle between two lines

Intuition

Two lines' directions are vectors; the angle between them comes straight from the dot product. Use direction ratios in the numerator and the product of magnitudes below — the same cosθ=abab\cos\theta = \frac{\vec a \cdot \vec b}{|\vec a||\vec b|} you know from vectors.

Definition

For lines with direction ratios a1,b1,c1\langle a_1,b_1,c_1\rangle and a2,b2,c2\langle a_2,b_2,c_2\rangle, the acute angle θ\theta between them satisfies the formula below. With direction cosines the denominator is 1, so cosθ=l1l2+m1m2+n1n2\cos\theta = l_1l_2 + m_1m_2 + n_1n_2.

Angle between two lines (direction ratios)

cosθ=a1a2+b1b2+c1c2a12+b12+c12a22+b22+c22\cos\theta = \frac{|a_1 a_2 + b_1 b_2 + c_1 c_2|}{\sqrt{a_1^2+b_1^2+c_1^2}\,\sqrt{a_2^2+b_2^2+c_2^2}}

Diagram · angle between two lines (drag to rotate)

xyzd₁d₂

d₁ = ⟨2, 2, 1⟩, d₂ = ⟨2, −1, 2⟩ · cos θ = |d₁·d₂| / (|d₁||d₂|) = 4/9 · θ ≈ 64°.

Worked example

Find the angle between the two lines with direction ratios 1,1,0\langle 1, 1, 0\rangle and 0,1,1\langle 0, 1, 1\rangle.
  1. Dot product: 1(0)+1(1)+0(1)=11(0) + 1(1) + 0(1) = 1.
  2. Magnitudes: 1+1+0=2\sqrt{1+1+0} = \sqrt2 and 0+1+1=2\sqrt{0+1+1} = \sqrt2.
  3. cosθ=122=12\cos\theta = \dfrac{1}{\sqrt2 \cdot \sqrt2} = \dfrac{1}{2}.
  4. So θ=60°\theta = 60°.
Answer:θ=60°\theta = 60° (i.e. π3\tfrac{\pi}{3}).
Practice this conceptself-check · 4 quick reps

Try it yourself

Find the angle between the lines 2x=3y=z2x = 3y = -z and 6x=y=4z6x = -y = -4z.

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    cosθ\cos\theta for 1,0,0\langle 1,0,0\rangle and 0,1,0\langle 0,1,0\rangle?
  2. 2.
    Angle between identical direction ratios?
  3. 3.
    Lines are perpendicular when the dot product of DRs is?
  4. 4.
    cosθ\cos\theta for 1,1,0\langle1,1,0\rangle,1,0,0\langle1,0,0\rangle?

From the bank · past-year question

Example 43D GeometryMODERATE
What is the angle between the two lines having direction ratios 6,3,6\langle 6, 3, 6\rangle and 3,3,0\langle 3, 3, 0\rangle?

[Q66 · Apr · 2021]

Concept 5 of 7

Perpendicular and parallel conditions

Intuition

Two lines are parallel when their direction ratios are proportional, and perpendicular when their dot product is zero. These two one-line tests answer a surprising share of the bank — and a line perpendicular to two given lines has direction ratios given by their cross product.

Definition

Lines a1,b1,c1\langle a_1,b_1,c_1\rangle and a2,b2,c2\langle a_2,b_2,c_2\rangle are:

  • Parallel iff a1a2=b1b2=c1c2\dfrac{a_1}{a_2} = \dfrac{b_1}{b_2} = \dfrac{c_1}{c_2}.
  • Perpendicular iff a1a2+b1b2+c1c2=0a_1a_2 + b_1b_2 + c_1c_2 = 0.

A line perpendicular to both has direction ratios equal to their cross product a1,b1,c1×a2,b2,c2\langle a_1,b_1,c_1\rangle \times \langle a_2,b_2,c_2\rangle.

Perpendicularity condition

a1a2+b1b2+c1c2=0a_1 a_2 + b_1 b_2 + c_1 c_2 = 0

Worked example

Find the direction ratios of a line perpendicular to both 1,2,1\langle 1, 2, 1\rangle and 2,1,1\langle 2, -1, 1\rangle.
  1. Take the cross product 1,2,1×2,1,1\langle 1,2,1\rangle \times \langle 2,-1,1\rangle.
  2. i:(2)(1)(1)(1)=3;j:[(1)(1)(1)(2)]=(1)=1;k:(1)(1)(2)(2)=5i: (2)(1) - (1)(-1) = 3;\quad j: -[(1)(1) - (1)(2)] = -(-1) = 1;\quad k: (1)(-1) - (2)(2) = -5.
  3. Direction ratios: 3,1,5\langle 3, 1, -5\rangle.
  4. Check perpendicular to the first: 3+25=03 + 2 - 5 = 0 ✓.
Answer:3,1,5\langle 3, 1, -5\rangle.
Practice this conceptself-check · 4 quick reps

Try it yourself

For what value of xx is the line 2,1,2\langle 2, -1, 2\rangle perpendicular to x,3,5\langle x, 3, 5\rangle?

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    Are 1,2,3\langle 1,2,3\rangle and 2,4,6\langle 2,4,6\rangle parallel?
  2. 2.
    Are 1,0,0\langle 1,0,0\rangle and 0,2,0\langle 0,2,0\rangle perpendicular?
  3. 3.
    Perpendicular-to-both is found via which operation?
  4. 4.
    Find k if 1,k,22,3,1\langle 1,k,2\rangle \perp \langle 2,3,-1\rangle.

From the bank · past-year question

Example 53D GeometryMODERATE
Under which one of the following conditions are the lines x=ay+b;  z=cy+dx=ay+b;\; z=cy+d and x=ey+f;  z=gy+hx=ey+f;\; z=gy+h perpendicular?

[Q65 · Apr · 2017]

Concept 6 of 7

Projection of a segment on an axis or line

Intuition

The projection of a segment onto an axis is simply how far it reaches along that axis — the difference of the relevant coordinates. Onto a general line, it's the segment's length times the cosine of the angle, which equals the dot product of the segment vector with the line's direction cosines.

Definition

Projection of AB\overrightarrow{AB} on the x-axis is x2x1x_2 - x_1 (and similarly for y, z). Projection on a line with direction cosines l,m,n\langle l, m, n\rangle is (x2x1)l+(y2y1)m+(z2z1)n(x_2-x_1)l + (y_2-y_1)m + (z_2-z_1)n.

Projection of AB on a line of direction cosines ⟨l, m, n⟩

proj=(x2x1)l+(y2y1)m+(z2z1)n\text{proj} = (x_2-x_1)\,l + (y_2-y_1)\,m + (z_2-z_1)\,n

Worked example

Find the projection of the segment joining A(2,1,4)A(2, -1, 4) and B(7,3,1)B(7, 3, 1) on the x-axis.
  1. Projection on the x-axis = difference of x-coordinates.
  2. x2x1=72=5x_2 - x_1 = 7 - 2 = 5.
Answer:55 (length 55 along the x-axis).
Practice this conceptself-check · 4 quick reps

Try it yourself

Project AB\overrightarrow{AB} with A(0,0,0),B(2,3,6)A(0,0,0), B(2,3,6) onto the line with direction cosines 13,23,23\langle \tfrac13, \tfrac23, \tfrac23\rangle.

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    Projection of segment (1,2,3)(1,2,3)(4,2,3)(4,2,3) on the x-axis?
  2. 2.
    Projection on the z-axis of (0,0,1)(0,0,1)(0,0,9)(0,0,9)?
  3. 3.
    Projection on the y-axis equals which coordinate difference?
  4. 4.
    If a segment is perpendicular to a line, its projection on the line is?

From the bank · past-year question

Example 63D GeometryEASY
What is the projection of the line segment joining A(1,7,5)A(1,7,-5) and B(3,4,2)B(-3,4,-2) on yy-axis?

[Q68 · Apr · 2021]

Concept 7 of 7

Direction-angle identities

Intuition

Because cos2α+cos2β+cos2γ=1\cos^2\alpha + \cos^2\beta + \cos^2\gamma = 1, a chain of useful identities follows for the angles a line makes with the axes — for example the sines square-sum to 2, and cos2α+cos2β+cos2γ=1\cos2\alpha + \cos2\beta + \cos2\gamma = -1. These power the chapter's hardest one-liners.

Definition

From l2+m2+n2=1l^2+m^2+n^2 = 1 with l=cosαl=\cos\alpha etc.:

  • sin2α+sin2β+sin2γ=2\sin^2\alpha + \sin^2\beta + \sin^2\gamma = 2 (subtract the cosine identity from 3).
  • cos2α+cos2β+cos2γ=1\cos2\alpha + \cos2\beta + \cos2\gamma = -1 (use cos2θ=2cos2θ1\cos2\theta = 2\cos^2\theta - 1).
  • Product form: cos(α+β)cos(αβ)=cos2αsin2β\cos(\alpha+\beta)\cos(\alpha-\beta) = \cos^2\alpha - \sin^2\beta.

Core identities

cos2 ⁣θ=1,sin2 ⁣θ=2,cos2θ=1\sum \cos^2\!\theta = 1, \quad \sum \sin^2\!\theta = 2, \quad \sum \cos 2\theta = -1

Worked example

A line makes angles α,β,γ\alpha, \beta, \gamma with the axes. Show sin2α+sin2β+sin2γ=2\sin^2\alpha + \sin^2\beta + \sin^2\gamma = 2.
  1. Each sin2θ=1cos2θ\sin^2\theta = 1 - \cos^2\theta.
  2. Sum: (1cos2α)+(1cos2β)+(1cos2γ)=3(cos2α+cos2β+cos2γ)(1-\cos^2\alpha) + (1-\cos^2\beta) + (1-\cos^2\gamma) = 3 - (\cos^2\alpha+\cos^2\beta+\cos^2\gamma).
  3. The bracket is the direction-cosine identity =1= 1.
  4. So the sum =31=2= 3 - 1 = 2.
Answer:sin2α+sin2β+sin2γ=2\sin^2\alpha + \sin^2\beta + \sin^2\gamma = 2.
Practice this conceptself-check · 4 quick reps

Try it yourself

A line makes 60°60° with the x-axis and 60°60° with the y-axis. What acute angle does it make with the z-axis?

Practice — Level 1 (4 reps)

Quick reps to lock in the method. Try each, then check.

  1. 1.
    cos2α+cos2β+cos2γ=?\cos^2\alpha + \cos^2\beta + \cos^2\gamma = ?
  2. 2.
    sin2α+sin2β+sin2γ=?\sin^2\alpha + \sin^2\beta + \sin^2\gamma = ?
  3. 3.
    cos2α+cos2β+cos2γ=?\cos2\alpha + \cos2\beta + \cos2\gamma = ?
  4. 4.
    Can a line make 45°45° with all three axes?

From the bank · past-year question

Example 73D GeometryHARD
If a line in 3 dimensions makes angles α,β\alpha, \beta and γ\gamma with the positive directions of the coordinate axes, then what is cos(α+β)cos(αβ)\cos(\alpha+\beta)\cos(\alpha-\beta) equal to?

[Q61 · Apr · 2025]

A line cannot make equal acute angles with all three axes unless it's the diagonal

If α=β=γ\alpha=\beta=\gamma, then 3cos2α=13\cos^2\alpha = 1, so cosα=13\cos\alpha = \tfrac{1}{\sqrt3} (54.7°\approx 54.7°), NOT 45°45° or 60°60°. Options offering 45°/60° for the equal-angle case are distractors.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (5)

  • Direction ratios, direction cosines, and the unit identity

    Direction cosines square-sum to 1

    l2+m2+n2=1,l=cosα, m=cosβ, n=cosγl^2 + m^2 + n^2 = 1, \quad l = \cos\alpha,\ m = \cos\beta,\ n = \cos\gamma
  • Angle between two lines

    Angle between two lines (direction ratios)

    cosθ=a1a2+b1b2+c1c2a12+b12+c12a22+b22+c22\cos\theta = \frac{|a_1 a_2 + b_1 b_2 + c_1 c_2|}{\sqrt{a_1^2+b_1^2+c_1^2}\,\sqrt{a_2^2+b_2^2+c_2^2}}
  • Perpendicular and parallel conditions

    Perpendicularity condition

    a1a2+b1b2+c1c2=0a_1 a_2 + b_1 b_2 + c_1 c_2 = 0
  • Projection of a segment on an axis or line

    Projection of AB on a line of direction cosines ⟨l, m, n⟩

    proj=(x2x1)l+(y2y1)m+(z2z1)n\text{proj} = (x_2-x_1)\,l + (y_2-y_1)\,m + (z_2-z_1)\,n
  • Direction-angle identities

    Core identities

    cos2 ⁣θ=1,sin2 ⁣θ=2,cos2θ=1\sum \cos^2\!\theta = 1, \quad \sum \sin^2\!\theta = 2, \quad \sum \cos 2\theta = -1

Reference tables (1)

Direction cosines of the axes and special lines4 rows
LineDirection cosinesNote
x-axis1,0,0\langle 1, 0, 0 \ranglemakes 0° with x, 90° with y and z
y-axis0,1,0\langle 0, 1, 0 \rangleDCs 0,1,0\langle 0,1,0\rangle; DRs e.g. 0,4,0\langle 0,4,0\rangle
z-axis0,0,1\langle 0, 0, 1 \rangleperpendicular to the whole XY-plane
⊥ to z-axisn=0n = 0, e.g. 5,6,0\langle 5, 6, 0\ranglelies in / parallel to the XY-plane
A line perpendicular to the z-axis just needs its z-component zero — the x, y parts are free.
Parallel to an axis → that axis's DCs. Perpendicular to an axis → a zero in that slot.

Watch out for (3)

Mastery check — 5 interleaved questions

Try each one before clicking. Questions are interleaved across the concepts above, not grouped — interleaving sharpens transfer.

Example 13D GeometryMODERATE
A plane cuts intercepts 2, 2, 1 on the coordinate axes. What are the direction cosines of the normal to the plane?

[Q64 · Sep · 2022]

Example 23D GeometryEASY
A straight line with direction cosines 0,1,0\langle 0, 1, 0\rangle is

[Q61 · Apr · 2017]

Example 33D GeometryMODERATE
If a line x+1p=y1q=z2r\frac{x+1}{p} = \frac{y-1}{q} = \frac{z-2}{r}, where p=2q=3rp = 2q = 3r, makes an angle θ\theta with the positive direction of yy-axis, then what is cos2θ\cos 2\theta equal to?

[Q64 · Apr · 2025]

Example 43D GeometryHARD
ABCDEFGH is a cuboid with base ABCD. Let A(0, 0, 0), B(12, 0, 0), C(12, 6, 0) and G(12, 6, 4) be the vertices. If α\alpha is the angle between AB and AG; β\beta is the angle between AC and AG, then what is the value of cos2α+cos2β\cos 2\alpha+\cos 2\beta?

[Q65 · Sep · 2021]

Example 53D GeometryHARD
Consider the following for the items that follow: Consider two lines whose direction ratios are (2,1,2)(2,-1,2) and (k,3,5)(k,3,5). They are inclined at an angle π4\dfrac{\pi}{4}.
What is the value of kk?

[Q63 · Apr · 2023]

Drill every past-year question on this subtopic

24 questions from the bank — paginated, with cart and Word-export support.