Lines and planes are perhaps the simplest of curves and surfaces in three dimensional space. They also will prove important as we seek to understand more complicated curves and surfaces.

The equation of a line in two dimensions is $ax+by=c$; it is reasonable to expect that a line in three dimensions is given by $ax + by +cz = d$; reasonable, but wrong—it turns out that this is the equation of a plane.

A plane does not have an obvious "direction'' as does a line. It is
possible to associate a plane with a direction in a very useful way,
however: there are exactly two directions perpendicular to a
plane. Any vector with one of these two directions is called
**normal** to the plane.
So while there are many normal vectors to a given plane, they are all
parallel or anti-parallel to each other.

Suppose two points $\ds (v_1,v_2,v_3)$ and $\ds (w_1,w_2,w_3)$ are in a plane;
then the vector $\ds \langle w_1-v_1,w_2-v_2,w_3-v_3\rangle$ is parallel
to the plane; in particular, if this vector is placed with its tail at
$\ds (v_1,v_2,v_3)$ then its head is at $\ds (w_1,w_2,w_3)$ and it lies in the
plane. As a result, any vector perpendicular to the plane is
perpendicular to $\ds \langle w_1-v_1,w_2-v_2,w_3-v_3\rangle$. In fact, it
is easy to see that the plane consists of *precisely* those points
$\ds (w_1,w_2,w_3)$ for which $\ds \langle w_1-v_1,w_2-v_2,w_3-v_3\rangle$ is
perpendicular to a normal to the plane, as indicated in
figure 14.5.1. That is, suppose
we know that $\langle a,b,c\rangle$ is normal to a plane containing
the point $\ds (v_1,v_2,v_3)$. Then $(x,y,z)$ is in the plane if and only
if $\langle a,b,c\rangle$ is perpendicular to $\ds \langle
x-v_1,y-v_2,z-v_3\rangle$. In turn, we know that this is true
precisely when $\ds \langle a,b,c\rangle\cdot\langle
x-v_1,y-v_2,z-v_3\rangle=0$. Thus, $(x,y,z)$ is in the plane if and
only if
$$\eqalign{
\langle a,b,c\rangle\cdot\langle x-v_1,y-v_2,z-v_3\rangle&=0\cr
a(x-v_1)+b(y-v_2)+c(z-v_3)&=0\cr
ax+by+cz-av_1-bv_2-cv_3&=0\cr
ax+by+cz&=av_1+bv_2+cv_3.\cr
}$$
Working backwards, note that if $(x,y,z)$ is a point satisfying
$ax+by+cz=d$ then
$$\eqalign{
ax+by+cz&=d\cr
ax+by+cz-d&=0\cr
a(x-d/a)+b(y-0)+c(z-0)&=0\cr
\langle a,b,c\rangle\cdot\langle x-d/a,y,z\rangle&=0.\cr
}$$
Namely, $\langle a,b,c\rangle$ is perpendicular to the vector with
tail at $(d/a,0,0)$ and head at $(x,y,z)$. This means that the points
$(x,y,z)$ that satisfy the equation $ax+by+cz=d$ form a plane
perpendicular to $\langle a,b,c\rangle$. (This doesn't
work if $a=0$, but in that case we can use $b$ or $c$ in the role of
$a$. That is, either $a(x-0)+b(y-d/b)+c(z-0)=0$ or
$a(x-0)+b(y-0)+c(z-d/c)=0$.)

Thus, given a vector $\langle a,b,c\rangle$ we know that all planes perpendicular to this vector have the form $ax+by+cz=d$, and any surface of this form is a plane perpendicular to $\langle a,b,c\rangle$.

Example 14.5.1 Find an equation for the plane perpendicular to $\langle 1,2,3\rangle$ and containing the point $(5,0,7)$.

Using the derivation above, the plane is $1x+2y+3z=1\cdot5+2\cdot0+3\cdot7=26$. Alternately, we know that the plane is $x+2y+3z=d$, and to find $d$ we may substitute the known point on the plane to get $5+2\cdot0+3\cdot7=d$, so $d=26$. We could also write this simply as $(x-5)+2(y)+3(z-7)=0$, which is for many purposes a fine representation; it can always be multiplied out to give $x+2y+3z=26$. $\square$

Example 14.5.2 Find a vector normal to the plane $2x-3y+z=15$.

One example is $\langle 2, -3,1\rangle$. Any vector parallel or anti-parallel to this works as well, so for example $-2\langle 2, -3,1\rangle=\langle -4,6,-2\rangle$ is also normal to the plane. $\square$

We will frequently need to find an equation for a plane given certain information about the plane. While there may occasionally be slightly shorter ways to get to the desired result, it is always possible, and usually advisable, to use the given information to find a normal to the plane and a point on the plane, and then to find the equation as above.

Example 14.5.3 The planes $x-z=1$ and $y+2z=3$ intersect in a line. Find a third plane that contains this line and is perpendicular to the plane $x+y-2z=1$.

First, we note that two planes are perpendicular if and only if their normal vectors are perpendicular. Thus, we seek a vector $\langle a,b,c\rangle$ that is perpendicular to $\langle 1,1,-2\rangle$. In addition, since the desired plane is to contain a certain line, $\langle a,b,c\rangle$ must be perpendicular to any vector parallel to this line. Since $\langle a,b,c\rangle$ must be perpendicular to two vectors, we may find it by computing the cross product of the two. So we need a vector parallel to the line of intersection of the given planes. For this, it suffices to know two points on the line. To find two points on this line, we must find two points that are simultaneously on the two planes, $x-z=1$ and $y+2z=3$. Any point on both planes will satisfy $x-z=1$ and $y+2z=3$. It is easy to find values for $x$ and $z$ satisfying the first, such as $x=1, z=0$ and $x=2, z=1$. Then we can find corresponding values for $y$ using the second equation, namely $y=3$ and $y=1$, so $(1,3,0)$ and $(2,1,1)$ are both on the line of intersection because both are on both planes. Now $\langle 2-1,1-3,1-0\rangle=\langle 1,-2,1\rangle$ is parallel to the line. Finally, we may choose $\langle a,b,c\rangle=\langle 1,1,-2\rangle\times \langle 1,-2,1\rangle=\langle -3,-3,-3\rangle$. While this vector will do perfectly well, any vector parallel or anti-parallel to it will work as well, so for example we might choose $\langle 1,1,1\rangle$ which is anti-parallel to it.

Now we know that $\langle 1,1,1\rangle$ is normal to the desired plane and $(2,1,1)$ is a point on the plane. Therefore an equation of the plane is $x+y+z=4$. As a quick check, since $(1,3,0)$ is also on the line, it should be on the plane; since $1+3+0=4$, we see that this is indeed the case.

Note that had we used $\langle -3,-3,-3\rangle$ as the normal, we would have discovered the equation $-3x-3y-3z=-12$, then we might well have noticed that we could divide both sides by $-3$ to get the equivalent $x+y+z=4$. $\square$

So we now understand equations of planes; let us turn to lines. Unfortunately, it turns out to be quite inconvenient to represent a typical line with a single equation; we need to approach lines in a different way.

Unlike a plane, a line in three dimensions does have an obvious direction, namely, the direction of any vector parallel to it. In fact a line can be defined and uniquely identified by providing one point on the line and a vector parallel to the line (in one of two possible directions). That is, the line consists of exactly those points we can reach by starting at the point and going for some distance in the direction of the vector. Let's see how we can translate this into more mathematical language.

Suppose a line contains the point $\ds (v_1,v_2,v_3)$ and is parallel
to the vector $\langle a,b,c\rangle$; we call $\langle a,b,c\rangle$ a
**direction vector** for the line.
If we place the vector $\ds
\langle v_1,v_2,v_3\rangle$ with its tail at the origin and its head
at $\ds (v_1,v_2,v_3)$, and if we place the vector $\langle
a,b,c\rangle$ with its tail at $\ds (v_1,v_2,v_3)$, then the head of
$\langle a,b,c\rangle$ is at a point on the line. We can get to *any* point on the line by doing the same thing, except using
$t\langle a,b,c\rangle$ in place of $\langle a,b,c\rangle$, where $t$
is some real number. Because of the way vector addition works, the
point at the head of the vector $t\langle a,b,c\rangle$ is the point
at the head of the vector $\ds \langle v_1,v_2,v_3\rangle+t\langle
a,b,c\rangle$, namely $\ds (v_1+ta,v_2+tb,v_3+tc)$; see
figure 14.5.2.

In other words, as $t$ runs through all possible real values, the
vector $\ds \langle v_1,v_2,v_3\rangle+t\langle a,b,c\rangle$ points to
every point on the line when its tail is placed at the origin. Another
common way to write this is as a set of
**parametric equations**:
$$ x= v_1+ta\qquad y=v_2+tb \qquad z=v_3+tc.$$
It is occasionally useful to use this form of a line even in two
dimensions; a vector form for a line in the $x$-$y$ plane is
$\ds \langle v_1,v_2\rangle+t\langle a,b\rangle$, which is the same as
$\ds \langle v_1,v_2,0\rangle+t\langle a,b,0\rangle$.

Example 14.5.4 Find a vector expression for the line through $(6,1,-3)$ and $(2,4,5)$. To get a vector parallel to the line we subtract $\langle 6,1,-3\rangle-\langle2,4,5\rangle=\langle 4,-3,-8\rangle$. The line is then given by $\langle 2,4,5\rangle+t\langle 4,-3,-8\rangle$; there are of course many other possibilities, such as $\langle 6,1,-3\rangle+t\langle 4,-3,-8\rangle$. $\square$

Example 14.5.5 Determine whether the lines $\langle 1,1,1\rangle+t\langle 1,2,-1\rangle$ and $\langle 3,2,1\rangle+t\langle -1,-5,3\rangle$ are parallel, intersect, or neither.

In two dimensions, two lines either intersect or are parallel; in three dimensions, lines that do not intersect might not be parallel. In this case, since the direction vectors for the lines are not parallel or anti-parallel we know the lines are not parallel. If they intersect, there must be two values $a$ and $b$ so that $\langle 1,1,1\rangle+a\langle 1,2,-1\rangle= \langle 3,2,1\rangle+b\langle -1,-5,3\rangle$, that is, $$\eqalign{ 1+a&=3-b\cr 1+2a&=2-5b\cr 1-a&=1+3b\cr }$$ This gives three equations in two unknowns, so there may or may not be a solution in general. In this case, it is easy to discover that $a=3$ and $b=-1$ satisfies all three equations, so the lines do intersect at the point $(4,7,-2)$. $\square$

Example 14.5.6 Find the distance from the point $(1,2,3)$ to the plane $2x-y+3z=5$. The distance from a point $P$ to a plane is the shortest distance from $P$ to any point on the plane; this is the distance measured from $P$ perpendicular to the plane; see figure 14.5.3. This distance is the absolute value of the scalar projection of $\ds \overrightarrow{\strut QP}$ onto a normal vector $\bf n$, where $Q$ is any point on the plane. It is easy to find a point on the plane, say $(1,0,1)$. Thus the distance is $$ {\overrightarrow{\strut QP}\cdot {\bf n}\over|{\bf n}|}= {\langle 0,2,2\rangle\cdot\langle 2,-1,3\rangle\over|\langle 2,-1,3\rangle|}= {4\over\sqrt{14}}. $$ $\square$

Example 14.5.7 Find the distance from the point $(-1,2,1)$ to the line $\langle 1,1,1\rangle + t\langle 2,3,-1\rangle$. Again we want the distance measured perpendicular to the line, as indicated in figure 14.5.4. The desired distance is $$ |\overrightarrow{\strut QP}|\sin\theta= {|\overrightarrow{\strut QP}\times{\bf A}|\over|{\bf A}|}, $$ where $\bf A$ is any vector parallel to the line. From the equation of the line, we can use $Q=(1,1,1)$ and ${\bf A}=\langle 2,3,-1\rangle$, so the distance is $$ {|\langle -2,1,0\rangle\times\langle2,3,-1\rangle|\over\sqrt{14}}= {|\langle-1,-2,-8\rangle|\over\sqrt{14}}={\sqrt{69}\over\sqrt{14}}. $$ $\square$

## Exercises 14.5

You can use Sage to compute distances to lines and planes, since this just involves vector arithmetic that we have already seen. Of course, you can also use Sage to do some of the computations involved in finding equations of planes and lines.

**Ex 14.5.1**
Find an equation of the plane containing $(6,2,1)$ and
perpendicular to $\langle 1,1,1\rangle$.
(answer)

**Ex 14.5.2**
Find an equation of the plane containing $(-1,2,-3)$ and
perpendicular to $\langle 4,5,-1\rangle$.
(answer)

**Ex 14.5.3**
Find an equation of the plane containing $(1,2,-3)$,
$(0,1,-2)$ and $(1,2,-2)$.
(answer)

**Ex 14.5.4**
Find an equation of the plane containing $(1,0,0)$,
$(4,2,0)$ and $(3,2,1)$.
(answer)

**Ex 14.5.5**
Find an equation of the plane containing $(1,0,0)$ and the
line $\langle 1,0,2\rangle + t\langle 3,2,1\rangle$.
(answer)

**Ex 14.5.6**
Find an equation of the plane containing the line of
intersection of $x+y+z=1$ and $x-y+2z=2$, and perpendicular to the
plane $2x+3y-z=4$.
(answer)

**Ex 14.5.7**
Find an equation of the plane containing the line of
intersection of $x+2y-z=3$ and $3x-y+4z=7$, and perpendicular to the
plane $6x-y+3z=16$.
(answer)

**Ex 14.5.8**
Find an equation of the plane containing the line of
intersection of $x+3y-z=6$ and $2x+2y-3z=8$, and perpendicular to the
plane $3x+y-z=11$.
(answer)

**Ex 14.5.9**
Find an equation of the line through $(1,0,3)$ and
$(1,2,4)$.
(answer)

**Ex 14.5.10**
Find an equation of the line through $(1,0,3)$ and
perpendicular to the plane $x+2y-z=1$.
(answer)

**Ex 14.5.11**
Find an equation of the line through the origin
and perpendicular to the plane $x+y-z=2$.
(answer)

**Ex 14.5.12**
Find $a$ and $c$ so that $(a,1,c)$ is on the line through
$(0,2,3)$ and $(2,7,5)$.
(answer)

**Ex 14.5.13**
Explain how to discover the solution in
example 14.5.5.

**Ex 14.5.14**
Determine whether the lines $\langle 1,3,-1\rangle+t\langle
1,1,0\rangle$ and $\langle 0,0,0\rangle+t\langle 1,4,5\rangle$ are
parallel, intersect, or neither.
(answer)

**Ex 14.5.15**
Determine whether the lines $\langle 1,0,2\rangle+t\langle
-1,-1,2\rangle$ and $\langle 4,4,2\rangle+t\langle 2,2,-4\rangle$ are
parallel, intersect, or neither.
(answer)

**Ex 14.5.16**
Determine whether the lines $\langle 1,2,-1\rangle+t\langle
1,2,3\rangle$ and $\langle 1,0,1\rangle+t\langle 2/3,2,4/3\rangle$ are
parallel, intersect, or neither.
(answer)

**Ex 14.5.17**
Determine whether the lines $\langle 1,1,2\rangle+t\langle
1,2,-3\rangle$ and $\langle 2,3,-1\rangle+t\langle 2,4,-6\rangle$ are
parallel, intersect, or neither.
(answer)

**Ex 14.5.18**
Find a unit normal vector to each of the coordinate planes.

**Ex 14.5.19**
Show that $\langle 2,1,3 \rangle + t \langle 1,1,2 \rangle$ and
$\langle 3, 2, 5 \rangle + s \langle 2, 2, 4 \rangle$ are the same
line.

**Ex 14.5.20**
Give a prose description for each of the following processes:

a. Given two distinct points, find the line that goes through them.

b. Given three points (not all on the same line), find the plane that goes through them. Why do we need the caveat that not all points be on the same line?

c. Given a line and a point not on the line, find the plane that contains them both.

d. Given a plane and a point not on the plane, find the line that is perpendicular to the plane through the given point.

**Ex 14.5.21**
Find the distance from $(2,2,2)$ to $x+y+z=-1$.
(answer)

**Ex 14.5.22**
Find the distance from $(2,-1,-1)$ to $2x-3y+z=2$.
(answer)

**Ex 14.5.23**
Find the distance from $(2,-1,1)$ to
$\langle 2,2,0\rangle+t\langle 1,2,3\rangle$.
(answer)

**Ex 14.5.24**
Find the distance from $(1,0,1)$ to
$\langle 3,2,1\rangle+t\langle 2,-1,-2\rangle$.
(answer)

**Ex 14.5.25**
Find the distance between the lines
$\langle 5,3,1\rangle+t\langle 2,4,3\rangle$ and
$\langle 6,1,0\rangle+t\langle 3,5,7\rangle$.
(answer)

**Ex 14.5.26**
Find the distance between the lines
$\langle 2,1,3\rangle+t\langle -1,2,-3\rangle$ and
$\langle 1,-3,4\rangle+t\langle 4,-4,1\rangle$.
(answer)

**Ex 14.5.27**
Find the distance between the lines
$\langle 1,2,3\rangle+t\langle 2,-1,3\rangle$ and
$\langle 4,5,6\rangle+t\langle -4,2,-6\rangle$.
(answer)

**Ex 14.5.28**
Find the distance between the lines
$\langle 3,2,1\rangle+t\langle 1,4,-1\rangle$ and
$\langle 3,1,3\rangle+t\langle 2,8,-2\rangle$.
(answer)

**Ex 14.5.29**
Find the cosine of the angle
between the planes $x+y+z=2$ and $x+2y+3z=8$.
(answer)

**Ex 14.5.30**
Find the cosine of the angle
between the planes $x-y+2z=2$ and $3x-2y+z=5$.
(answer)