Lines & Planes in Space

In the plane, a line is $y = mx + b$ and you're done. Try that in space and it falls apart: one equation in $x$, $y$, and $z$ cuts out a whole flat sheet, not a line, and "slope" doesn't even mean anything when there are three directions to rise in. So this page starts over with the tools from Dot & Cross Products. A line is a starting point plus a direction. A plane is a starting point plus two directions, or, better, a point plus the one direction it never moves in.

The practice is mixed into the lesson: each question sits right after the idea it needs, and the Mixed Practice at the bottom takes that hint away. Flip the switch on a question to type your answer instead: a line like (1, 2, 0) + t(3, -1, 2), a plane like 3x - y + 2z = 5, or a point like (1, 2, 0). Any correct line or plane is accepted, not just the one in the answer key.

Lines in Space

Pick a point $p$ to start from and a nonzero vector $v$ to travel along. Walking $t$ steps of $v$ from $p$ lands you at $p + tv$. Let $t$ run over every real number, negatives included, and you trace out a line:

Each value of $t$ is one point: $t = 0$ is $p$ itself, $t = 1$ is one step of $v$ along, $t = -1$ is one step back. That's the whole definition.

Let $p$ be a point in $\R^3$ and $v$ a nonzero vector. The line through $p$ in the direction $v$ is the set $$L = \{p + tv : t \in \R\}.$$

Any such $v$ is called a direction vector of $L$. Writing a general point as $(x, y, z)$, we write the line as $(x, y, z) = p + tv$. Split into coordinates, that's three parametric equations $x = p_1 + tv_1$, $y = p_2 + tv_2$, $z = p_3 + tv_3$, with $t$ as the parameter.

On Vectors, all the multiples $cv$ of one arrow made a line through $0$, and that page promised it was where lines in space begin. Here's the payoff: when $p = 0$, the line is exactly those multiples. Every other line is that line slid over by $p$.

When $p = 0$, the line is $\{tv\} = \operatorname{span}\{v\}$, a span. Every other line is that span slid over by $p$: $L = p + \operatorname{span}\{v\}$.

That slide is worth watching once. The line through $0$ is a subspace; slide it off the origin and it's still a line, just not a subspace anymore:

That slide is worth watching once. The line through $0$ has a special property: add two of its points, or stretch one, and you stay on the line. A later page calls a set like that a subspace, and calls the multiples of $v$ its span, $\operatorname{span}\{v\}$. Slide the line off the origin and it's still a line, but it loses that property, because it misses $0$:

Two points are all it takes to pin a line down: start at one, and aim at the other.

Find the line through $A = (1, 2, -1)$ and $B = (3, -1, 4)$. Is $(5, -4, 9)$ on it?


The direction is $B - A = (2, -3, 5)$, so the line is $(x, y, z) = (1, 2, -1) + t(2, -3, 5)$. Check: $t = 1$ gives $B$.

For $(5, -4, 9)$, the $x$-coordinate forces $1 + 2t = 5$, so $t = 2$. Then $y = 2 - 6 = -4$ and $z = -1 + 10 = 9$. All three match, so yes, it's on the line, at $t = 2$.


The walk, and a point where the coordinates can't agree on $t$:

That check needs one value of $t$ that works for all three coordinates. If the $x$-coordinate wants $t = 2$ and the $y$-coordinate wants $t = 3$, the point is off the line. Now aim a line yourself:

Aim the Line

You probably found a different $p$ and $v$ than your neighbor would, and you're both right. A line has lots of names. Here's exactly when two of them name the same line.

The lines $p + tv$ and $q + sw$ (with $v, w \ne 0$) are the same line exactly when $w$ is a multiple of $v$ and $q$ lies on the first line.

Show proof

Suppose they're the same line. Then $q$ (at $s = 0$) is on the first line, and so is $q + w$ (at $s = 1$): $q = p + t_0v$ and $q + w = p + t_1v$. Subtracting, $w = (t_1 - t_0)v$, a multiple of $v$.

Conversely, suppose $q = p + t_0v$ and $w = cv$, where $c \ne 0$ because $w \ne 0$. Every point of the second line is $q + sw = p + (t_0 + sc)v$, so it's on the first line. Every point of the first line is $p + tv = q + \frac{t - t_0}{c}w$, so it's on the second. Same set of points. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. It leans on one fact from geometry class: through a given point there is exactly one line in a given direction. Call the first line $L_1$, and watch a second line through $q$ as its direction $w$ swings:

If $w$ isn't along $v$, the second line aims somewhere else, so it leaves $L_1$ the moment it passes $q$: they share just that one point. If $w$ is along $v$ but $q$ is off $L_1$, the second line is the one line through $q$ in $v$'s direction, a parallel copy that never touches $L_1$. Only with both, $w$ along $v$ and $q$ on $L_1$, is the second line the one line through $q$ in $v$'s direction, which $L_1$ already is. The full proof is in the n version.

So to compare two descriptions, check the directions (parallel?) and one point (on the other line?). Sort a few:

Same Line?

The parallel-but-shifted card is the one that catches people, and it's worth saying out loud.

Parallel directions aren't enough on their own: $(0, 0, 0) + t(1, 1, 1)$ and $(1, 0, 0) + t(1, 1, 1)$ have the same direction but are two different, parallel lines. Always check a point too. And a line in space has no single equation: "$y = 2x + 1$" in $\R^3$ is a whole plane.

Your turn. The free-response version takes any correct description of the line.

Loading practice engine...

Planes in Space

A line had one direction to move in. Give a point two directions that don't line up, and every combination of them sweeps out a flat sheet:

The grid lines are $s$ fixed and $t$ fixed. Through $0$ it's the span of $u$ and $v$; slide it by $p$ and you get the plane through $p$.

The grid lines are $s$ fixed and $t$ fixed. Through $0$ it's every combination $su + tv$ (the figure's label, $\operatorname{span}\{u, v\}$, is the later page's name for it); slide it by $p$ and you get the plane through $p$.

Let $p$ be a point in $\R^3$ and $u$, $v$ vectors, neither a multiple of the other. The plane through $p$ spanned by $u$ and $v$ is the set $$P = \{p + su + tv : s, t \in \R\}.$$

That description is great for walking around on the plane, and awful for asking "is this point on it?", since you'd have to solve for $s$ and $t$. There's a much better way to describe a plane, and it uses the one direction the plane never moves in.

A nonzero vector $n$ is a normal vector to the plane $p + su + tv$ if $n$ is orthogonal to both $u$ and $v$.

Then $n$ is orthogonal to every $su + tv$ too, since $n \cdot (su + tv) = s(n \cdot u) + t(n \cdot v) = 0$. And the cross product hands you one for free: $n = u \times v$. Watch a point wander around the plane while the arrow from $p$ to it stays square to $n$:

A plane gets one normal direction. A line in space gets a whole plane's worth of them. Lines got the better deal.

For every point $r$ on the plane, $n \cdot (r - p)$ is $0$. The moment the point lifts off, it isn't. That's the whole test, and it gives every plane an equation.

Let $P$ be the plane through $p$ with normal vector $n = (a, b, c)$. A point $(x, y, z)$ lies on $P$ exactly when $$n \cdot ((x, y, z) - p) = 0, \qquad \text{that is,} \qquad ax + by + cz = d, \ \text{ where } d = n \cdot p.$$ Conversely, for any $(a, b, c) \ne 0$ and any $d$, the points satisfying $ax + by + cz = d$ form a plane with normal vector $(a, b, c)$.

Show proof

Write $P = \{p + su + tv\}$, and call a point $r$. If $r$ is on $P$, then $r - p = su + tv$, which is orthogonal to $n$ (above). So $n \cdot (r - p) = 0$.

Now suppose $n \cdot (r - p) = 0$. First, $u$, $v$, $n$ are linearly independent: if $\alpha u + \beta v + \gamma n = 0$, take the dot product with $n$ to get $\gamma\|n\|^2 = 0$, so $\gamma = 0$, and then $\alpha = \beta = 0$ because neither of $u$, $v$ is a multiple of the other. Three independent vectors in $\R^3$ form a basis, so $r - p = \alpha u + \beta v + \gamma n$ for some numbers. Dot with $n$ again: $0 = \gamma\|n\|^2$, so $\gamma = 0$ and $r - p = \alpha u + \beta v$. That puts $r$ on $P$. Writing $r = (x, y, z)$ and expanding, $n \cdot (r - p) = 0$ reads $ax + by + cz = n \cdot p$.

For the converse, say $a \ne 0$ (the other cases are the same with the letters moved). Solving for $x$, the solutions are exactly $$(x, y, z) = \left(\tfrac{d}{a}, 0, 0\right) + y\left(-\tfrac{b}{a}, 1, 0\right) + z\left(-\tfrac{c}{a}, 0, 1\right),$$ with $y$ and $z$ free. The last two vectors aren't multiples of each other (look at their last two entries), so this is a plane, and $(a, b, c)$ is orthogonal to both of them. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. Stand at $p$ with the sheet's two directions $u$ and $v$ and the normal $n$. Any point $r$ in space can be reached in two legs: walk along the sheet (some $su + tv$), then climb straight along $n$ (some multiple $\gamma n$). That's the one fact this leans on: three arrows that don't lie in one plane reach every point of space. Now watch $n \cdot (r - p)$ as $r$ moves:

The walk adds nothing to the dot product, because $n$ is square to $u$ and $v$. So $n \cdot (r - p) = \gamma (n \cdot n)$, just the climb, scaled. It's $0$ exactly when there's no climb, that is, exactly when $r$ is on the sheet. Writing $r = (x, y, z)$ and multiplying out turns $n \cdot (r - p) = 0$ into $ax + by + cz = n \cdot p$.

The other direction is shorter than it looks. Given $ax + by + cz = d$ with $(a, b, c) \ne 0$, pick any one point $p$ that satisfies it (if $a \ne 0$, $p = \left(\frac{d}{a}, 0, 0\right)$ works). Then $d = n \cdot p$, so the equation says $n \cdot ((x, y, z) - p) = 0$, and those are exactly the points the picture found: the plane through $p$ with normal $n$. The full proof is in the n version.

So the normal is read straight off the coefficients, and $d$ comes from plugging in any one point. Three points work too: two edges give $u$ and $v$, and their cross product gives $n$.

Find the equation of the plane through $A = (1, 2, 0)$, $B = (3, 0, 1)$, and $C = (0, 1, 2)$.


Two edges: $u = B - A = (2, -2, 1)$ and $v = C - A = (-1, -1, 2)$. Their cross product is $$u \times v = ((-2)(2) - (1)(-1), \ (1)(-1) - (2)(2), \ (2)(-1) - (-2)(-1)) = (-3, -5, -4).$$ Any multiple is also a normal, so use $n = (3, 5, 4)$. Then $d = n \cdot A = 3 + 10 + 0 = 13$, and the plane is $3x + 5y + 4z = 13$.

Check the other two points: $9 + 0 + 4 = 13$ and $0 + 5 + 8 = 13$.


The same steps, in space:

Now the other direction, from an equation back to a plane you can walk around on. Solve for one variable and let the other two run free.

Write the plane $2x - y + 3z = 6$ in the form $p + su + tv$.


Solve for $y$: $y = 2x + 3z - 6$. With $x = s$ and $z = t$ free, $(x, y, z) = (s, \ 2s + 3t - 6, \ t) = (0, -6, 0) + s(1, 2, 0) + t(0, 3, 1)$.

Check that $n = (2, -1, 3)$ is orthogonal to both directions: $2 - 2 + 0 = 0$ and $0 - 3 + 3 = 0$.


The grid this builds, one step at a time:

The planes with $d = 0$ are the special ones: they pass through $0$, so adding two of their points or stretching one never leaves the plane. On Subspaces they get a name, and it turns out every flat thing through $0$ in space is a point, a line, a plane, or all of space.

On Subspaces, planes through $0$ had equations like $x - 2y + z = 0$. Same planes, with $d = 0$. A plane is a subspace exactly when $d = 0$, since a subspace has to contain $0$.

Your turn to steer a plane. You control the normal and $d$; get all three stars onto the plane at once:

Three Stars

The number $ax + by + cz - d$ does more than test "on or off". Its sign says which side of the plane you're on, since it's $n \cdot ((x, y, z) - p)$: positive on the side $n$ points to, negative on the other. Guess before you look:

Above, Below, or On?

Notice that the size of the miss, divided by $\|n\| = 3$, was the distance to the plane. Hang on to that for the last section. First, a few traps with plane equations.

Doubling the whole equation gives the same plane: $x + 2y - z = 4$ and $2x + 4y - 2z = 8$ are one plane. Doubling only the left side does not: $2x + 4y - 2z = 4$ is a parallel plane. And $d$ is not the distance from the origin, unless $\|n\| = 1$. (Some books write the plane as a(x − x₀) + b(y − y₀) + c(z − z₀) = 0, the "point-normal form". Same equation, before you multiply out.)

$ax + by + cz = d$ has four numbers, but double all of them and nothing happens. So a plane really only costs three. I want a refund on the fourth.

Your turn. Any multiple of the right equation is accepted when you type it.

Loading practice engine...

How Lines Meet

Two lines in the plane either cross, run parallel, or are secretly the same line. Space adds a fourth option, and it's the one people forget. Look at these two lines from straight above, then let the camera tip down and swing around:

From above they cross. From the side, one passes clean over the other. Lines that never meet and aren't parallel are called skew, and they're why "do these lines meet?" takes real work in space.

In the plane, two lines that never meet are parallel, end of story. In space they can just... ignore each other. Skew lines are roommates who never make eye contact.

Two lines $L_1 = p + tv$ and $L_2 = q + sw$ in $\R^3$ do exactly one of these:

  1. they are the same line;
  2. they are parallel ($w$ a multiple of $v$) and never meet;
  3. they meet in exactly one point ($w$ not a multiple of $v$, and $(q - p) \cdot (v \times w) = 0$);
  4. they are skew: not parallel, and they never meet ($(q - p) \cdot (v \times w) \ne 0$).
Show proof

If $w$ is a multiple of $v$, the theorem on two descriptions of a line says the lines are the same exactly when $q$ is on $L_1$. If they aren't the same, they can't share a point $r$ either: then $L_2 = r + sw$ and $L_1 = r + tv$ would be the same line by that theorem. That's cases 1 and 2.

If $w$ isn't a multiple of $v$, they share at most one point: two shared points would make both lines the line through those two points, with parallel directions. They meet exactly when $p + tv = q + sw$ for some $t$, $s$, that is, when $q - p = tv - sw$ lies in $\operatorname{span}\{v, w\}$. That span is the plane through $0$ with normal $v \times w$, so by the plane theorem, $q - p$ is in it exactly when $(q - p) \cdot (v \times w) = 0$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. Cases 1 and 2 (parallel directions) are the theorem on two descriptions of a line: same line if $q$ is on $L_1$, a parallel copy if not. So suppose $v$ and $w$ aren't parallel, and lay a sheet through $L_1$ in the directions $v$ and $w$. $L_2$ runs in direction $w$ too, so either it lies in that sheet, or it hovers beside it, parallel, never touching. In the sheet, $L_1$ and $L_2$ are two non-parallel lines on one flat plane, and those cross, once, just like lines on paper. Hovering beside it, $L_2$ never touches the sheet, so it never touches $L_1$: skew.

The triple product tells the two apart. On Dot & Cross Products, $(q - p) \cdot (v \times w)$ was the signed volume of the box on $q - p$, $v$, and $w$, and that box is flat exactly when $q - p$ lies in the sheet. Here the picture is turned so the sheet is the floor, and $L_2$ slides up and down:

Flat box, the lines cross; any thickness at all, they're skew. The end of the loop shows why the test is only for non-parallel directions: when $w$ is a multiple of $v$, $v \times w = 0$ and every box is flat, so the volume can't tell a shared line from a parallel copy. The full proof is in the n version.

In practice: set $p + tv = q + sw$, solve two of the three coordinate equations for $t$ and $s$, and then check the third. If it fails, the lines are skew. The two examples below are the same pair of lines, except for one number.

Do $L_1: (x, y, z) = (1, 3, -2) + t(1, -1, 2)$ and $L_2: (x, y, z) = (5, 0, 5) + s(-2, 1, -3)$ meet? What if $L_2$ starts at $(5, 0, 6)$ instead?


Set them equal: $1 + t = 5 - 2s$, $\ 3 - t = s$, $\ -2 + 2t = 5 - 3s$. The second says $s = 3 - t$; put that in the first: $1 + t = 5 - 6 + 2t$, so $t = 2$ and $s = 1$. Check the third: $-2 + 4 = 2$ and $5 - 3 = 2$. It works, so they meet at $t = 2$ on $L_1$: the point $(3, 1, 2)$.

With $L_2$ starting at $(5, 0, 6)$, the first two equations haven't changed, so again $t = 2$, $s = 1$. But the third now reads $-2 + 4 = 6 - 3$, that is, $2 = 3$. False. The directions aren't parallel, so the lines are skew. (The triple product agrees: $v \times w = (1, -1, -1)$ and $q - p = (4, -3, 8)$ give $4 + 3 - 8 = -1 \ne 0$.)


The two walkers, before and after that one number changes:

Sort some pairs of lines. Each card turns into a picture you can spin once you've decided:

Meet or Miss

Two habits make the "meet" pairs go smoothly.

Give the two lines different parameter letters before you set them equal. If both lines use $t$, writing $p + tv = q + tw$ asks for the two walkers to arrive at the same point at the same time, which is a different (and usually impossible) question. And the skipped check is the classic mistake: two equations in two unknowns almost always have a solution, so the third equation is the real test.

Your turn. Some pairs meet, and some are skew.

Loading practice engine...

Lines Meeting Planes, and Planes Meeting Planes

A line against a plane is easier, because the plane is one equation. Substitute the line into it and you get one equation in $t$.

Let $L = p + tv$ and let $P$ be the plane $n \cdot (x, y, z) = d$.

  1. If $n \cdot v \ne 0$, then $L$ meets $P$ in exactly one point, at $t = \frac{d - n \cdot p}{n \cdot v}$.
  2. If $n \cdot v = 0$ and $p$ is on $P$, the whole line lies in $P$.
  3. If $n \cdot v = 0$ and $p$ is not on $P$, the line runs parallel to $P$ and never meets it.
Show proof

The point $p + tv$ is on $P$ exactly when $n \cdot (p + tv) = d$, that is, $n \cdot p + t(n \cdot v) = d$. If $n \cdot v \ne 0$, this has the one solution in the statement. If $n \cdot v = 0$, it reads $n \cdot p = d$ no matter what $t$ is: true for every $t$ if $p$ is on $P$, and false for every $t$ if not. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. Put the walker $p + tv$ into the left side of the plane's equation and subtract $d$: $$n \cdot (p + tv) - d = (n \cdot p - d) + t(n \cdot v).$$ That number is the walker's height above the plane, measured in steps of $n$ (it's $0$ on the plane, positive on the side $n$ points to). Each step of $t$ changes it by the same amount, $n \cdot v$, so its graph against $t$ is a straight line:

A sloped straight line crosses $0$ exactly once: that's case 1, at $t = \frac{d - n \cdot p}{n \cdot v}$. A flat one ($n \cdot v = 0$: the direction runs flat along the plane) never changes, so it's $0$ the whole way when $p$ is on the plane (case 2) and never $0$ when it isn't (case 3). The full proof is in the n version.

In words: $n \cdot v = 0$ means the line's direction lies flat along the plane, so it either lives in the plane or hovers beside it forever.

Where does $(x, y, z) = (1, 0, 2) + t(2, 1, -1)$ cross the plane $x + 2y + 3z = 10$?


Substitute: $(1 + 2t) + 2(t) + 3(2 - t) = 10$, so $7 + t = 10$ and $t = 3$. The point is $(1, 0, 2) + 3(2, 1, -1) = (7, 3, -1)$. Check: $7 + 6 - 3 = 10$.


Count along the line:

Your turn.

Loading practice engine...

Two planes are the last case. Unless they're parallel, they cross along a line, and that line runs orthogonal to both normals, which is exactly the job of the cross product:

So the direction is $n_1 \times n_2$, and all that's left is one point on both planes.

Let $P_1$ be $n_1 \cdot (x, y, z) = d_1$ and $P_2$ be $n_2 \cdot (x, y, z) = d_2$.

  1. If $n_1$ and $n_2$ are not parallel, $P_1$ and $P_2$ meet in a line with direction $n_1 \times n_2$.
  2. If $n_2 = cn_1$, the planes are the same when $d_2 = cd_1$, and parallel (never meeting) otherwise.
Show proof

(2) If $n_2 = cn_1$, the second equation is $c(n_1 \cdot r) = d_2$ for a point $r$. When $d_2 = cd_1$ it's the first equation times $c$, the same plane. Otherwise a common point $r$ would need $n_1 \cdot r$ to equal both $d_1$ and $\frac{d_2}{c} \ne d_1$, impossible.

(1) Let $m = n_1 \times n_2$, nonzero since the normals aren't parallel. Then $n_1$, $n_2$, $m$ are a basis (as in the plane theorem's proof). First a common point: look for one of the form $r_0 = \alpha n_1 + \beta n_2$. The two equations become $\alpha\|n_1\|^2 + \beta(n_1 \cdot n_2) = d_1$ and $\alpha(n_1 \cdot n_2) + \beta\|n_2\|^2 = d_2$, a $2 \times 2$ system whose determinant $\|n_1\|^2\|n_2\|^2 - (n_1 \cdot n_2)^2 = \|m\|^2$ (Lagrange's identity) isn't zero, so it has a solution. Now a point $r$ is on both planes exactly when $n_1 \cdot (r - r_0) = 0 = n_2 \cdot (r - r_0)$. Write $r - r_0 = a n_1 + b n_2 + c m$; the two conditions say $(a, b)$ solves the same system with right side $0$, so $a = b = 0$. So the common points are exactly $r_0 + cm$: a line with direction $n_1 \times n_2$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof, and it has two parts. Part 2 is the equations themselves: when $n_2 = cn_1$, the second equation is the first times $c$ (same plane) or contradicts it (never meeting).

For part 1, the direction first. A line lying in both planes runs flat along each, so it's square to both normals, and in space the arrows square to two non-parallel arrows all lie along one direction: their cross product. That's the picture above. Then, why do the planes meet at all? This leans on a fact from solid geometry: a plane tilted against another cuts through it, wherever you slide it. Here $P_1$ is the floor:

Slide the tilted plane any way you like and the crossing line slides with it, but it never disappears. Tip it toward flat and the crossing runs off toward the horizon while $n_1 \times n_2$ shrinks; only when the normals are parallel ($n_1 \times n_2 = 0$) can the planes miss, and that's part 2. The full proof is in the n version.

That proof builds the point the hard way. By hand, there's a shortcut: set one coordinate to $0$ and solve the two equations that are left.

To find a point by hand, there's a shortcut: set one coordinate to $0$ and solve the two equations that are left.

Find the line where $x + y + z = 6$ and $x - y + 2z = 5$ meet.


Direction: $(1, 1, 1) \times (1, -1, 2) = (1 \cdot 2 - 1 \cdot (-1), \ 1 \cdot 1 - 1 \cdot 2, \ 1 \cdot (-1) - 1 \cdot 1) = (3, -1, -2)$.

A point: setting $z = 0$ gives $x + y = 6$ and $x - y = 5$, so $x = 5.5$. That works, but setting $y = 0$ gives nicer numbers: $x + z = 6$ and $x + 2z = 5$, so $z = -1$ and $x = 7$. The point $(7, 0, -1)$ is on both planes ($7 - 1 = 6$, $7 - 2 = 5$), so the line is $(x, y, z) = (7, 0, -1) + t(3, -1, -2)$.


Both shortcuts, seen as slices of space:

Steer the second plane and watch the line of intersection move, vanish, and come back:

Two Planes

Two plane equations at once made a line. On Systems, the next page, it's three at once, and every way three planes can meet: one point, a whole line, a whole plane, or nowhere at all.

The solutions of two plane equations came out as "one point plus every multiple of a direction". On Solution Sets, that's the shape of every solution set of a system: one particular solution plus every solution of the associated homogeneous system.

Your turn. Any point on the line and any multiple of its direction is accepted.

Loading practice engine...

Distance from a Point to a Plane

How far is a point $q$ from a plane $P$? There are infinitely many points on $P$ to measure to, and we want the closest one. On Dot & Cross Products, the closest point on a line was the foot of the perpendicular. Same here: drop straight down along the normal.

Pick any point $p$ on the plane. The straight-down distance is the length of the shadow of $q - p$ on the normal, and the projection formula computes it. The distance from $q$ to $P$, written $\operatorname{dist}(q, P)$, means the smallest $\|q - r\|$ over all points $r$ of $P$; the theorem shows there is a smallest one, and finds it.

The distance from $q = (x_0, y_0, z_0)$ to the plane $ax + by + cz = d$ is $$\operatorname{dist}(q, P) = \frac{|ax_0 + by_0 + cz_0 - d|}{\sqrt{a^2 + b^2 + c^2}} = \frac{|n \cdot q - d|}{\|n\|},$$ and the closest point of $P$ to $q$ is $f = q - \frac{n \cdot q - d}{\|n\|^2} \, n$.

Show proof

First, $f$ is on $P$: $n \cdot f = n \cdot q - \frac{n \cdot q - d}{\|n\|^2}\|n\|^2 = d$. And $q - f$ is a multiple of $n$, with length $\frac{|n \cdot q - d|}{\|n\|^2}\|n\| = \frac{|n \cdot q - d|}{\|n\|}$.

Now take any $r$ on $P$. Then $n \cdot (f - r) = d - d = 0$, so $f - r$ is orthogonal to $n$, and therefore to $q - f$. By Pythagoras, $$\|q - r\|^2 = \|(q - f) + (f - r)\|^2 = \|q - f\|^2 + 2((q - f) \cdot (f - r)) + \|f - r\|^2 = \|q - f\|^2 + \|f - r\|^2 \ge \|q - f\|^2.$$ So no point of $P$ is closer than $f$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. Drop from $q$ straight along the normal and land at the foot $f$. For any other point $r$ of the plane, the triangle $q$, $f$, $r$ has a right angle at $f$: $q - f$ runs along $n$, and $f - r$ lies flat in the plane. So $q$ to $r$ is a hypotenuse, and Pythagoras says it beats the leg $q$ to $f$ unless $r$ is $f$:

The leg's length is the formula. From any point $p$ of the plane, the drop $q - f$ is the shadow of $q - p$ on $n$ (Dot & Cross Products), whose length is $\frac{|n \cdot (q - p)|}{\|n\|} = \frac{|n \cdot q - d|}{\|n\|}$, since $n \cdot p = d$. The full proof is in the n version.

The numerator is just "plug $q$ into the equation and see how far it misses $d$". Dividing by $\|n\|$ turns that miss into a real distance.

Find the distance from $q = (2, 1, 3)$ to the plane $2x - y + 2z = 1$, and the closest point.


Plug in: $n \cdot q = 4 - 1 + 6 = 9$, which misses $d = 1$ by $8$. With $\|n\| = \sqrt{4 + 1 + 4} = 3$, the distance is $\frac{8}{3}$.

The closest point is $f = (2, 1, 3) - \frac{8}{9}(2, -1, 2) = \left(\frac{2}{9}, \frac{17}{9}, \frac{11}{9}\right)$. Check: $\frac{4}{9} - \frac{17}{9} + \frac{22}{9} = 1$.


The miss of $8$, measured with a ruler along $n$:

Don't trust the formula? Hunt for a shorter path:

Shortest Path

Parallel planes come for free: every point of one is the same distance from the other, so pick a point and use the formula. If both are written with the same normal, the distance between $ax + by + cz = d_1$ and $ax + by + cz = d_2$ is $\frac{|d_1 - d_2|}{\|n\|}$. For example, $x + 2y + 2z = 3$ and $x + 2y + 2z = 12$ are $\frac{9}{3} = 3$ apart.

Before subtracting the $d$'s, make the two equations use the same normal: $x + 2y + 2z = 3$ and $2x + 4y + 4z = 12$ are only $\frac{|3 - 6|}{3} = 1$ apart, because the second one is really $x + 2y + 2z = 6$. And don't forget the absolute value: a distance is never negative, even when the point is on the "minus" side.

Your turn: points and planes, and pairs of parallel planes.

Loading practice engine...

That's lines and planes: a point plus directions to write them down, a normal to test them, the cross product to build normals and directions, and the dot product to measure. Time to take the hints away.

Mixed Practice

Every question so far came right after its idea, which is a hint a quiz never gives you. Down here the hint is gone. First, true or false: a claim from anywhere on this page, and you decide whether it holds.

Loading practice engine...

Next, a mixed set: every question type on this page, shuffled. Deciding whether you're facing a line, a plane, or a meeting point is half the work.

Loading practice engine...

Made it this far? Time for something with a little heat: how far apart are two skew lines? Hint: there's a plane through the second line that runs parallel to the first. What's its normal?

🌶️ SPICY BONUS 🌶️

Loading practice engine...