3D Geometry: Direction Cosines, Lines and Planes
Three-dimensional geometry extends coordinate geometry to space by adding a third axis, z. Points become triples (x, y, z), lines are described by direction cosines or direction ratios, and a plane has a linear equation ax + by + cz + d = 0. Entry tests mostly ask for distances, the section formula, direction cosines, the angle between lines or planes, plane equations and the distance of a point from a plane.
Asked in: ECAT, NUST NET, JEE Main, FSc and Class 11-12 boards
Coordinates and distance in space
Three mutually perpendicular axes through the origin O divide space into eight octants. A point P(x, y, z) has x, y and z as its perpendicular distances, with sign, from the yz-, zx- and xy-planes.
The distance formula is Pythagoras' theorem applied twice. Every point of the xy-plane has z = 0, every point of the x-axis has y = z = 0, and so on.
- PQ = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]
- OP = √(x² + y² + z²)
- xy-plane: z = 0; yz-plane: x = 0; zx-plane: y = 0
Section formula, midpoint and centroid
The point dividing the join of A(x₁, y₁, z₁) and B(x₂, y₂, z₂) internally in the ratio m : n is found coordinate by coordinate, exactly as in two dimensions. For external division replace n by −n.
To find the ratio in which a coordinate plane divides a segment, take the ratio as k : 1 and set the relevant coordinate of the dividing point to zero. A positive k means internal division, a negative k external.
- Internal m : n: ((mx₂ + nx₁)/(m + n), (my₂ + ny₁)/(m + n), (mz₂ + nz₁)/(m + n))
- Midpoint: ((x₁ + x₂)/2, (y₁ + y₂)/2, (z₁ + z₂)/2)
- Centroid of a triangle: ((x₁ + x₂ + x₃)/3, (y₁ + y₂ + y₃)/3, (z₁ + z₂ + z₃)/3)
Direction cosines and direction ratios
If a line makes angles α, β and γ with the positive x-, y- and z-axes, then l = cos α, m = cos β and n = cos γ are its direction cosines. Their squares always add up to 1.
Any three numbers a, b, c proportional to l, m, n are direction ratios. The line joining two points has direction ratios x₂ − x₁, y₂ − y₁, z₂ − z₁. To turn direction ratios into direction cosines, divide each by √(a² + b² + c²).
- l² + m² + n² = 1
- cos²α + cos²β + cos²γ = 1
- l = a/√(a² + b² + c²), and similarly for m and n
- Direction ratios of AB: x₂ − x₁, y₂ − y₁, z₂ − z₁
Angle between two lines
The angle between two lines is found from their direction ratios with the same dot-product idea used for vectors. Taking the modulus of the numerator gives the acute angle.
Two lines are perpendicular when a₁a₂ + b₁b₂ + c₁c₂ = 0 and parallel when their direction ratios are proportional. A line through (x₁, y₁, z₁) with direction ratios a, b, c has the symmetric equation shown below.
- 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₂
- Line: (x − x₁)/a = (y − y₁)/b = (z − z₁)/c
Equation of a plane
Every plane has an equation ax + by + cz + d = 0, and a, b, c are direction ratios of its normal (the line perpendicular to it). So a plane through (x₁, y₁, z₁) with normal direction ratios a, b, c is a(x − x₁) + b(y − y₁) + c(z − z₁) = 0.
A plane cutting the axes at (p, 0, 0), (0, q, 0) and (0, 0, r) has the intercept form. The angle between two planes is the angle between their normals.
- a(x − x₁) + b(y − y₁) + c(z − z₁) = 0
- Intercept form: x/p + y/q + z/r = 1
- Angle between planes: cos θ = |a₁a₂ + b₁b₂ + c₁c₂| ÷ [√(a₁² + b₁² + c₁²) √(a₂² + b₂² + c₂²)]
- Planes perpendicular: a₁a₂ + b₁b₂ + c₁c₂ = 0
Distance of a point from a plane
Substitute the point into the left side of the plane equation, take the absolute value, and divide by the length of the normal. The result is the perpendicular distance.
For two parallel planes, first make the coefficients of x, y and z identical, then subtract the constants. The foot of the perpendicular from a point lies on the line through the point along the normal.
- Distance of (x₁, y₁, z₁) from ax + by + cz + d = 0: |ax₁ + by₁ + cz₁ + d| ÷ √(a² + b² + c²)
- Distance from the origin: |d| ÷ √(a² + b² + c²)
- Parallel planes ax + by + cz + d₁ = 0 and ax + by + cz + d₂ = 0: |d₁ − d₂| ÷ √(a² + b² + c²)
Solved examples
- Find the distance between A(2, −1, 3) and B(4, 1, 4).
- Differences: 4 − 2 = 2, 1 − (−1) = 2 and 4 − 3 = 1.
- AB = √(2² + 2² + 1²) = √9 = 3.
Answer: 3 units - Find the point dividing the join of A(1, 2, −3) and B(7, −4, 3) internally in the ratio 1 : 2.
- m = 1, n = 2, so each coordinate is (1 × B + 2 × A)/3.
- x = (7 + 2)/3 = 3, y = (−4 + 4)/3 = 0, z = (3 − 6)/3 = −1.
- The point is (3, 0, −1), one third of the way from A to B.
Answer: (3, 0, −1) - A line has direction ratios 2, −1, 2. Find its direction cosines.
- √(2² + (−1)² + 2²) = √9 = 3.
- Divide each ratio by 3: l = 2/3, m = −1/3, n = 2/3.
- Check: 4/9 + 1/9 + 4/9 = 1.
Answer: 2/3, −1/3, 2/3 - Find the angle between the lines with direction ratios 1, 1, 0 and 1, 0, 1.
- a₁a₂ + b₁b₂ + c₁c₂ = 1 + 0 + 0 = 1.
- Each set of ratios has length √2, so cos θ = 1/(√2 × √2) = 1/2.
- θ = 60°.
Answer: 60° - Find the equation of the plane through (1, 2, 3) whose normal has direction ratios 2, −1, 2.
- Use a(x − x₁) + b(y − y₁) + c(z − z₁) = 0: 2(x − 1) − (y − 2) + 2(z − 3) = 0.
- Expand: 2x − 2 − y + 2 + 2z − 6 = 0.
- So the plane is 2x − y + 2z − 6 = 0. Check: 2 − 2 + 6 − 6 = 0 at (1, 2, 3).
Answer: 2x − y + 2z − 6 = 0 - Find the distance of the point (2, 1, −1) from the plane x − 2y + 2z + 5 = 0.
- Substitute: 2 − 2(1) + 2(−1) + 5 = 2 − 2 − 2 + 5 = 3.
- Length of the normal: √(1 + 4 + 4) = 3.
- Distance = |3| ÷ 3 = 1.
Answer: 1 unit
Exam shortcuts
- Direction cosines must satisfy l² + m² + n² = 1; if an option's squares do not add up to 1, it is only a set of direction ratios.
- For a perpendicularity question, set a₁a₂ + b₁b₂ + c₁c₂ = 0 and solve for the unknown; no square roots are needed.
- When comparing two parallel planes, make the x, y, z coefficients identical before subtracting the constants.
- For the ratio in which a coordinate plane cuts a segment, use the ratio −(coordinate of A) : (coordinate of B) for that plane's coordinate; a positive result means internal division.
- The foot of the perpendicular from the origin to ax + by + cz = d is t(a, b, c) with t = d ÷ (a² + b² + c²).
Common mistakes
- Treating direction ratios as direction cosines without dividing by √(a² + b² + c²).
- Forgetting the absolute value in the distance or angle formula, which can give a negative distance or an obtuse angle.
- Subtracting the constants of two parallel planes such as 2x − y + 2z + 3 = 0 and 4x − 2y + 4z + 5 = 0 without first dividing the second by 2.
- Writing the section formula as (mx₁ + nx₂)/(m + n); the ratio number m goes with the far point B.
- Mixing up the normal of a plane with a line lying in the plane; the coefficients of x, y, z give the normal.
Practice MCQs
- The distance of the point P(3, 4, 12) from the origin is:
A) 13
B) 19
C) 169
D) 5
Answer: A) 13 — OP = √(9 + 16 + 144) = √169 = 13. Adding the coordinates gives 19, 169 is OP², and 5 ignores the z-coordinate. - The midpoint of the join of (2, −3, 4) and (6, 5, −2) is:
A) (4, −1, 3)
B) (8, 2, 2)
C) (4, 1, 1)
D) (2, 4, −3)
Answer: C) (4, 1, 1) — Average each coordinate: ((2 + 6)/2, (−3 + 5)/2, (4 − 2)/2) = (4, 1, 1). (8, 2, 2) forgets to halve, and (2, 4, −3) is half the differences. - The centroid of the triangle with vertices (1, 2, 3), (3, −1, 0) and (5, 5, 6) is:
A) (3, 3, 3)
B) (9, 6, 9)
C) (3, 2, 3)
D) (4.5, 3, 4.5)
Answer: C) (3, 2, 3) — Add the coordinates and divide by 3: (9/3, 6/3, 9/3) = (3, 2, 3). (9, 6, 9) are the sums before dividing, and (4.5, 3, 4.5) divides by 2 instead of 3. - A line makes angles of 60° with the x-axis and 45° with the y-axis. The acute angle it makes with the z-axis is:
A) 60°
B) 30°
C) 45°
D) 90°
Answer: A) 60° — cos²γ = 1 − cos²60° − cos²45° = 1 − 1/4 − 1/2 = 1/4, so cos γ = 1/2 and γ = 60°. 45° simply repeats the y-axis angle, 90° would need cos²60° + cos²45° = 1 (it is only 3/4), and 30° comes from taking sin γ = 1/2. - The direction cosines of the line joining (1, 2, 3) and (3, 5, 9) are:
A) 1/7, 2/7, 3/7
B) 2/7, 3/7, 6/7
C) 2/11, 3/11, 6/11
D) 2, 3, 6
Answer: B) 2/7, 3/7, 6/7 — Direction ratios are 3 − 1, 5 − 2, 9 − 3 = 2, 3, 6, and √(4 + 9 + 36) = 7, so the direction cosines are 2/7, 3/7, 6/7. 2, 3, 6 are only ratios, and 2/11 divides by the sum 11 instead of the root of the sum of squares. - The lines with direction ratios 2, −1, 1 and 1, 3, k are perpendicular. Then k equals:
A) 1
B) −5
C) 5
D) −1
Answer: A) 1 — Perpendicular lines need 2(1) + (−1)(3) + 1(k) = 0, so −1 + k = 0 and k = 1. Taking the middle product as +3 gives k = −5. - The angle between the lines with direction ratios 1, 2, 2 and 2, −2, 1 is:
A) 90°
B) 0°
C) 60°
D) 45°
Answer: A) 90° — a₁a₂ + b₁b₂ + c₁c₂ = 2 − 4 + 2 = 0, so cos θ = 0 and the lines are perpendicular. 0° would need the ratios to be proportional, which they are not. - The yz-plane divides the join of (−2, 4, 7) and (3, −5, 8) in the ratio:
A) 3 : 2 internally
B) 3 : 2 externally
C) 2 : 3 externally
D) 2 : 3 internally
Answer: D) 2 : 3 internally — On the yz-plane x = 0. With ratio k : 1, x = (3k − 2)/(k + 1) = 0 gives k = 2/3, positive, so the ratio is 2 : 3 internally. The points have x-coordinates of opposite sign, which already shows the plane lies between them. - The plane that cuts the x-, y- and z-axes at 2, 3 and 4 respectively is:
A) 2x + 3y + 4z = 1
B) 4x + 3y + 6z = 12
C) 2x + 3y + 4z = 12
D) 6x + 4y + 3z = 12
Answer: D) 6x + 4y + 3z = 12 — Intercept form: x/2 + y/3 + z/4 = 1. Multiply by 12: 6x + 4y + 3z = 12. Check (2, 0, 0): 12 = 12. Putting the intercepts in as coefficients, as in 2x + 3y + 4z = 12, gives a plane that cuts the x-axis at 6, not 2. - The plane through (1, −1, 2) perpendicular to the line with direction ratios 3, 4, −1 is:
A) 3x + 4y − z + 1 = 0
B) 3x + 4y − z + 3 = 0
C) 3x + 4y − z − 3 = 0
D) x − y + 2z − 6 = 0
Answer: B) 3x + 4y − z + 3 = 0 — The line is the normal, so 3(x − 1) + 4(y + 1) − (z − 2) = 0, which is 3x + 4y − z + 3 = 0. Check: 3 − 4 − 2 + 3 = 0. The plane x − y + 2z − 6 = 0 contains the point but has the wrong normal. - The distance of the point (1, 1, 1) from the plane 2x + y − 2z + 8 = 0 is:
A) 7/3
B) 9
C) 3
D) 1
Answer: C) 3 — |2 + 1 − 2 + 8| ÷ √(4 + 1 + 4) = 9 ÷ 3 = 3. Forgetting to divide by √9 gives 9, and taking the constant as −8 gives 7/3. - The planes 2x + ky − 3z = 1 and x + 2y + 4z = 5 are perpendicular when k equals:
A) 10
B) 5
C) −7
D) −5
Answer: B) 5 — Perpendicular planes have perpendicular normals: 2(1) + k(2) + (−3)(4) = 0, so 2k = 10 and k = 5. Taking (−3)(4) as +12 gives −7, dropping the 2 that multiplies k gives 10, and a sign slip in solving 2k = 10 gives −5. - The distance between the parallel planes 2x − y + 2z + 3 = 0 and 4x − 2y + 4z + 5 = 0 is:
A) 1/3
B) 8/3
C) 2/3
D) 1/6
Answer: D) 1/6 — Divide the second equation by 2: 2x − y + 2z + 5/2 = 0. Then distance = |3 − 5/2| ÷ √9 = (1/2) ÷ 3 = 1/6. Subtracting 3 and 5 directly gives 2/3, and adding them gives 8/3. - The foot of the perpendicular from the origin to the plane 2x + y − 2z = 9 is:
A) (−2, −1, 2)
B) (4, 2, −4)
C) (2, 1, −2)
D) (1, 2, −2)
Answer: C) (2, 1, −2) — The foot lies on the normal through O, so it is (2t, t, −2t). Put it in the plane: 4t + t + 4t = 9, so t = 1 and the foot is (2, 1, −2). (4, 2, −4) is along the normal but gives 18, not 9, and (1, 2, −2) satisfies the plane but is not on the normal. - The angle between the lines with direction ratios 1, 1, 2 and √3 − 1, −√3 − 1, 4 is:
A) 30°
B) 60°
C) 90°
D) 45°
Answer: B) 60° — Dot product: (√3 − 1) + (−√3 − 1) + 8 = 6. Lengths: √6 and √[(√3 − 1)² + (√3 + 1)² + 16] = √(8 + 16) = √24. So cos θ = 6 ÷ (√6 × √24) = 6/12 = 1/2 and θ = 60°. Reading 1/2 as sin θ gives 30°.
Questions
What is the difference between direction cosines and direction ratios?
Direction cosines are the actual cosines of the angles a line makes with the axes, so their squares add to 1. Direction ratios are any three numbers proportional to them; for example 2, −1, 2 and 4, −2, 4 are direction ratios of the same line, whose direction cosines are 2/3, −1/3, 2/3.
How do I find the normal of a plane?
Read it from the equation. In ax + by + cz + d = 0, the numbers a, b, c are direction ratios of the normal, so 2x − y + 2z = 7 has normal direction ratios 2, −1, 2.
Why is there a modulus in the angle formula?
Two lines meeting at a point form two angles, θ and 180° − θ. The modulus picks the acute one, which is the usual meaning of the angle between two lines or two planes.
Can a line have direction cosines like 1/2, 1/2, 1/2?
No. Their squares add to 3/4, not 1, so no real line has these direction cosines. This check is a quick way to reject wrong options.