IMOClass 12 › Three-Dimensional Geometry

Three-Dimensional Geometry

Direction Cosines and Ratios

A line in space has a direction. The direction cosines of a line are the cosines of the angles $\alpha,\beta,\gamma$ that it makes with the positive $x$, $y$, $z$ axes, written $l=\cos\alpha,\ m=\cos\beta,\ n=\cos\gamma$.

The fundamental identity

Direction cosines always satisfy

$$l^2+m^2+n^2=1.$$

Direction ratios

Any three numbers $a,b,c$ proportional to $l,m,n$ are called direction ratios. They are not unique (any non-zero multiple works). To convert ratios to cosines, divide by the magnitude:

$$l=\frac{a}{\sqrt{a^2+b^2+c^2}},\quad m=\frac{b}{\sqrt{a^2+b^2+c^2}},\quad n=\frac{c}{\sqrt{a^2+b^2+c^2}}.$$

Line through two points

The direction ratios of the line through $A(x_1,y_1,z_1)$ and $B(x_2,y_2,z_2)$ are $x_2-x_1,\ y_2-y_1,\ z_2-z_1$.

Example 1: Find the direction cosines of a line with direction ratios $1,2,2$.

Magnitude $=\sqrt{1+4+4}=3$. So $l=\tfrac13,\ m=\tfrac23,\ n=\tfrac23$. Check $l^2+m^2+n^2=\tfrac{1+4+4}{9}=1.$

Example 2: Find direction ratios of the line joining $A(1,2,3)$ and $B(4,5,6)$.

$(4-1,5-2,6-3)=(3,3,3)$, or simplified $(1,1,1)$.

Example 3: If a line makes equal angles with the axes, find its direction cosines.

$l=m=n$. From $3l^2=1$, $l=\pm\dfrac{1}{\sqrt3}$. So the direction cosines are $\left(\tfrac{1}{\sqrt3},\tfrac{1}{\sqrt3},\tfrac{1}{\sqrt3}\right)$.

Example 4: Can $\tfrac12,\tfrac12,\tfrac12$ be direction cosines of a line?

Check $l^2+m^2+n^2=\tfrac14+\tfrac14+\tfrac14=\tfrac34\ne1$. So no — they fail the fundamental identity.

Quick recap
  • Direction cosines $l,m,n=\cos\alpha,\cos\beta,\cos\gamma$ with $l^2+m^2+n^2=1$.
  • Direction ratios are any numbers proportional to $l,m,n$ (not unique).
  • Convert ratios $a,b,c$ to cosines by dividing by $\sqrt{a^2+b^2+c^2}$.
  • Line through two points: DRs are the coordinate differences.
✓ Quick check
The shortest distance of the point (a, b, c) from the x-axis is:
The foot of the perpendicular from (a, b, c) to the x-axis is (a, 0, 0). The distance is √((a−a)² + (0−b)² + (0−c)²) = √(b² + c²).
Equation of the plane passing through (1, 1, −1) and perpendicular to the line x/1 = y/2 = z/3 is:
The plane's normal is the direction of the line, so n = i + 2j + 3k. Equation is 1(x−1) + 2(y−1) + 3(z+1) = 0 → x − 1 + 2y − 2 + 3z + 3 = 0 → x + 2y + 3z = 0.

Equation of a Line

A line is fixed by a point on it and a direction.

Vector form

The line through point $\vec a$ with direction $\vec b$ is

$$\vec r=\vec a+\lambda\,\vec b,\qquad \lambda\in\mathbb{R}.$$

Cartesian (symmetric) form

Through $(x_1,y_1,z_1)$ with direction ratios $a,b,c$:

$$\frac{x-x_1}{a}=\frac{y-y_1}{b}=\frac{z-z_1}{c}.$$

Line through two points

Through $A(x_1,y_1,z_1)$ and $B(x_2,y_2,z_2)$:

$$\frac{x-x_1}{x_2-x_1}=\frac{y-y_1}{y_2-y_1}=\frac{z-z_1}{z_2-z_1}.$$

Reading a Cartesian equation backwards: the denominators are the direction ratios and the subtracted numbers give a point on the line.

Example 1: Write the vector equation of the line through $(1,0,2)$ with direction $\hat i+\hat j-\hat k$.

$\vec r=(\hat i+2\hat k)+\lambda(\hat i+\hat j-\hat k).$

Example 2: Write the Cartesian equation of the line through $(2,-1,3)$ with DRs $1,2,2$.

$\dfrac{x-2}{1}=\dfrac{y+1}{2}=\dfrac{z-3}{2}.$

Example 3: Find the Cartesian equation of the line through $(1,2,3)$ and $(2,4,5)$.

DRs $(1,2,2)$. Equation: $\dfrac{x-1}{1}=\dfrac{y-2}{2}=\dfrac{z-3}{2}.$

Example 4: From $\dfrac{x-1}{2}=\dfrac{y+3}{-1}=\dfrac{z}{4}$, read a point and the direction ratios.

A point on the line is $(1,-3,0)$ and the direction ratios are $(2,-1,4)$.

Quick recap
  • Vector form: $\vec r=\vec a+\lambda\vec b$ (point $\vec a$, direction $\vec b$).
  • Cartesian form: $\dfrac{x-x_1}{a}=\dfrac{y-y_1}{b}=\dfrac{z-z_1}{c}$.
  • Two-point line: denominators are the coordinate differences.
  • Denominators = direction ratios; subtracted constants = a point on the line.
✓ Quick check
Equation of the plane passing through a point with position vector a and normal to the vector n is:
For any point r on the plane, the vector (r − a) lies in the plane, so it is perpendicular to the normal vector n. Thus, their dot product is zero: (r − a) · n = 0.
If a line makes equal angles with the coordinate axes, what is the positive direction cosine?
If α = β = γ, then 3cos²α = 1, so cos²α = 1/3, meaning cos α = 1/√3.

Plane, Distances and Angles

With two lines given by their direction vectors, two natural quantities arise: the angle between them and (if they do not meet) the shortest distance.

Angle between two lines

If the lines have direction vectors $\vec b_1,\vec b_2$, the angle $\theta$ between them satisfies

$$\cos\theta=\frac{|\vec b_1\cdot\vec b_2|}{|\vec b_1||\vec b_2|}.$$

They are perpendicular if $\vec b_1\cdot\vec b_2=0$ and parallel if $\vec b_1\times\vec b_2=\vec 0$.

Shortest distance between skew lines

For lines $\vec r=\vec a_1+\lambda\vec b_1$ and $\vec r=\vec a_2+\mu\vec b_2$, the shortest distance is

$$d=\frac{\left|(\vec a_2-\vec a_1)\cdot(\vec b_1\times\vec b_2)\right|}{|\vec b_1\times\vec b_2|}.$$

If $d=0$ the lines intersect (are coplanar). For parallel lines use $d=\dfrac{|(\vec a_2-\vec a_1)\times\vec b|}{|\vec b|}$.

Example 1: Find the angle between lines with directions $\vec b_1=\hat i+\hat j+\hat k$ and $\vec b_2=\hat i-\hat j+\hat k$.

$\vec b_1\cdot\vec b_2=1-1+1=1$. $|\vec b_1|=|\vec b_2|=\sqrt3$. $\cos\theta=\dfrac{|1|}{3}=\dfrac13$, so $\theta=\cos^{-1}\tfrac13.$

Example 2: Show the lines with directions $\hat i+\hat j$ and $\hat i-\hat j$ are perpendicular.

$\vec b_1\cdot\vec b_2=1\cdot1+1\cdot(-1)=0$, so the lines are perpendicular.

Example 3: Are lines with directions $2\hat i+4\hat j+6\hat k$ and $\hat i+2\hat j+3\hat k$ parallel?

The first is $2\times$ the second, so $\vec b_1\times\vec b_2=\vec 0$. The lines are parallel.

Example 4: State the shortest-distance formula and the condition for two lines to intersect.

$d=\dfrac{|(\vec a_2-\vec a_1)\cdot(\vec b_1\times\vec b_2)|}{|\vec b_1\times\vec b_2|}$. The lines intersect (are coplanar) when $d=0$, i.e. $(\vec a_2-\vec a_1)\cdot(\vec b_1\times\vec b_2)=0$.

Quick recap
  • Angle between lines: $\cos\theta=\dfrac{|\vec b_1\cdot\vec b_2|}{|\vec b_1||\vec b_2|}$.
  • Perpendicular $\iff \vec b_1\cdot\vec b_2=0$; parallel $\iff \vec b_1\times\vec b_2=\vec 0$.
  • Skew shortest distance: $d=\dfrac{|(\vec a_2-\vec a_1)\cdot(\vec b_1\times\vec b_2)|}{|\vec b_1\times\vec b_2|}$.
  • $d=0$ means the lines intersect (coplanar).
✓ Quick check
A shop's delivery drone moves from (2,1,0) to (5,5,4). Its direction ratios are:
Differences=(3,4,4).
Ravi's kite string forms a straight line given by (x−1)/2 = (y−2)/−1 = z/2. If the ground is the xy-plane, what is the sine of the angle the string makes with the ground?
Ground is xy-plane, normal is z-axis (0, 0, 1). Line DRs are 2, −1, 2. Angle with plane has sin θ = |a*l + b*m + c*n| / (mag1 * mag2). sin θ = |(2)(0) + (−1)(0) + (2)(1)| / (3 * 1) = 2/3.
Ready to test this chapter?
Take the Chapter Test →