Analytic geometry · Space
In the plane, one equation \(y = kx + b\) describes a line. In space a single linear equation describes a plane, so a line needs more. There are two natural ways to pin it down: by a point and a direction (and then the line is the path of a point moving with constant velocity), or as the intersection of two planes. This post covers both, shows how to switch between them, and collects the standard problems about angles, intersections and distances.
Through a point \(M_1(x_1, y_1, z_1)\) passes exactly one line parallel to a given nonzero vector \( \vec p = \{l, m, n\} \), called a direction vector of the line. A point \(M(x, y, z)\) lies on this line exactly when the vector \( \overrightarrow{M_1M} = \vec r - \vec r_1 \) is parallel to \(\vec p\). Everything below is a different way of writing "parallel".
1) Vector form: parallel vectors have zero cross product, so \[ (\vec r - \vec r_1)\times\vec p = \vec 0 \qquad\text{or}\qquad \vec r\times\vec p = \vec q, \quad \vec q = \vec r_1\times\vec p. \]
2) Canonical (symmetric) form: parallel vectors have proportional components, so \[ \frac{x - x_1}{l} = \frac{y - y_1}{m} = \frac{z - z_1}{n}. \]
3) Parametric form: calling the common ratio \(t\), \[ x = x_1 + lt, \qquad y = y_1 + mt, \qquad z = z_1 + nt. \]
How the forms relate. The parametric form is the vector equation \( \vec r = \vec r_1 + t\vec p \) written in components: start at \(M_1\) and move \(t\) times the vector \(\vec p\). If \(t\) is time, the point moves along the line with constant velocity \(\vec p\). Eliminating \(t\) (each coordinate gives \( t = \frac{x - x_1}{l} \), etc.) gives the canonical form, which is really two equations (hence "double equation"): two planes whose intersection is the line.
About the vector \(\vec q\). In \( \vec r\times\vec p = \vec q \), the vector \( \vec q = \vec r_1\times\vec p \) does not depend on which point \(M_1\) of the line we use (changing \(\vec r_1\) by a multiple of \(\vec p\) does not change the cross product). It is always perpendicular to \(\vec p\), and its length gives the distance of the line from the origin: \( d_O = \frac{|\vec q|}{|\vec p|} \).
To use the formulas of Sections 4–6 we need a point and a direction. The line lies in both planes, so its direction is perpendicular to both normals:
\[ \vec p = \vec N_1\times\vec N_2. \]For a point, fix one coordinate (often \(z = 0\)) and solve the remaining \(2\times2\) system. (If that system has no solution, the line is parallel to the plane \(z = 0\); fix another coordinate instead.)
A line has infinitely many pairs of planes through it (every pair from the pencil of planes through the line), so its general equations are far from unique. The canonical form is not unique either (any point, any multiple of \(\vec p\)), but the line itself is.
Angles between lines are angles between their direction vectors:
\[ \cos\varphi = \frac{|\vec p_1\cdot\vec p_2|}{|\vec p_1|\,|\vec p_2|} = \frac{|l_1l_2 + m_1m_2 + n_1n_2|}{\sqrt{l_1^2 + m_1^2 + n_1^2}\sqrt{l_2^2 + m_2^2 + n_2^2}}. \]This works even for skew lines (lines that neither meet nor are parallel); the angle is then measured after moving one line parallel to itself until they meet.
The angle \(\psi\) between a line and a plane is the angle between the line and its projection onto the plane. It is the complement of the angle between \(\vec p\) and the normal \(\vec N\), so the cosine turns into a sine:
\[ \sin\psi = \frac{|\vec N\cdot\vec p|}{|\vec N|\,|\vec p|} = \frac{|Al + Bm + Cn|}{\sqrt{A^2 + B^2 + C^2}\sqrt{l^2 + m^2 + n^2}}. \]The parametric form makes this easy: substitute \( x = x_1 + lt \), \( y = y_1 + mt \), \( z = z_1 + nt \) into the plane's equation. This gives one linear equation for \(t\):
\[ (Al + Bm + Cn)\,t + (Ax_1 + By_1 + Cz_1 + D) = 0. \]The vectors \( \overrightarrow{M_1M_0} \) and \(\vec p\) span a parallelogram whose area is \( |\overrightarrow{M_1M_0}\times\vec p| \). Its base is \(|\vec p|\) and its height is exactly the distance from \(M_0\) to the line:
\[ d = \frac{|\overrightarrow{M_1M_0}\times\vec p|}{|\vec p|}. \]Let the lines pass through \(M_1\), \(M_2\) with directions \(\vec p_1\), \(\vec p_2\). The vector \( \vec p_1\times\vec p_2 \) is perpendicular to both lines, so the shortest distance is the projection of \( \overrightarrow{M_1M_2} \) onto it:
\[ d = \frac{\big|\overrightarrow{M_1M_2}\cdot(\vec p_1\times\vec p_2)\big|}{|\vec p_1\times\vec p_2|}. \]The numerator is the absolute value of a mixed (triple) product. If it is zero, the two lines are coplanar (they intersect or are parallel); this is the test for whether two lines meet.
| Concept | Formula |
|---|---|
| Vector form | \( (\vec r - \vec r_1)\times\vec p = \vec 0 \); \( \vec r\times\vec p = \vec q \) |
| Canonical form | \( \frac{x - x_1}{l} = \frac{y - y_1}{m} = \frac{z - z_1}{n} \) |
| Parametric form | \( x = x_1 + lt,\ y = y_1 + mt,\ z = z_1 + nt \) |
| Intersection of planes | direction \( \vec p = \vec N_1\times\vec N_2 \) |
| Angle between lines | \( \cos\varphi = \frac{|\vec p_1\cdot\vec p_2|}{|\vec p_1||\vec p_2|} \) |
| Angle line–plane | \( \sin\psi = \frac{|\vec N\cdot\vec p|}{|\vec N||\vec p|} \) |
| Point to line | \( d = \frac{|\overrightarrow{M_1M_0}\times\vec p|}{|\vec p|} \) |
| Skew lines | \( d = \frac{|\overrightarrow{M_1M_2}\cdot(\vec p_1\times\vec p_2)|}{|\vec p_1\times\vec p_2|} \) |
Try each one before opening the solution. More solved problems from this topic are in Geometry.
\( x = 2 + 3t \), \( y = -1 \), \( z = 4t \). The line lies in the plane \(y = -1\).
Direction = normal \(\{2, -1, 1\}\): \( \frac{x - 1}{2} = \frac{y - 2}{-1} = \frac{z - 3}{1} \).
\( \{1, -1, 0\}\times\{0, 1, 1\} = \{-1, -1, 1\} \). A point: \(y = 0\) gives \(x = 0\), \(z = 1\). Line: \( \frac{x}{-1} = \frac{y}{-1} = \frac{z - 1}{1} \).
Both pass through \((1, 2, 3)\) (the first at \(t = 1\), the second at \(t = 0\)), and the directions are not parallel: yes, at \((1, 2, 3)\). (The mixed product of \(\{1, 2, 3\}\), \(\{1, 2, 3\}\), \(\{1, 1, 1\}\) is \(0\), as it must be.)
\( 1\cdot1 + 1\cdot2 + 3\cdot(-1) = 0 \): yes, parallel. The point \((1, 0, 3)\) gives \(1 + 0 + 9 \ne 0\), so the line does not lie in the plane.
\( \overrightarrow{M_1O} = \{-1, -1, -2\} \), \( \vec p = \{1, -1, 0\} \): cross product \( \{-2, -2, 2\} \), length \(2\sqrt3\); \( d = \frac{2\sqrt3}{\sqrt2} = \sqrt6 \).
A line in space is a point plus a direction. Its vector, canonical and parametric equations are three ways of saying "\(\overrightarrow{M_1M}\) is parallel to \(\vec p\)": a zero cross product, proportional components, a multiple \(t\vec p\). As the intersection of two planes, it gets its direction from the cross product of the normals. And the standard problems reduce to vector algebra: angles to dot products, distances to cross and mixed products, intersections to one equation in \(t\).
Related posts: the plane in space, and vectors (dot, cross and mixed products).