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$.
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.$
$(4-1,5-2,6-3)=(3,3,3)$, or simplified $(1,1,1)$.
$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)$.
Check $l^2+m^2+n^2=\tfrac14+\tfrac14+\tfrac14=\tfrac34\ne1$. So no — they fail the fundamental identity.
- 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.
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.
$\vec r=(\hat i+2\hat k)+\lambda(\hat i+\hat j-\hat k).$
$\dfrac{x-2}{1}=\dfrac{y+1}{2}=\dfrac{z-3}{2}.$
DRs $(1,2,2)$. Equation: $\dfrac{x-1}{1}=\dfrac{y-2}{2}=\dfrac{z-3}{2}.$
A point on the line is $(1,-3,0)$ and the direction ratios are $(2,-1,4)$.
- 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.
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|}$.
$\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.$
$\vec b_1\cdot\vec b_2=1\cdot1+1\cdot(-1)=0$, so the lines are perpendicular.
The first is $2\times$ the second, so $\vec b_1\times\vec b_2=\vec 0$. The lines are parallel.
$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$.
- 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).