\section{Lines and Planes}

\subsection{Planes in $\mathbb{R}^3$.} A plane in $\mathbb{R}^3$ is determined by a point on the plane and a vector perpendicular to it.  We will use this fact to determine the \textbf{standard form} of an equation of a plane in $\mathbb{R}^3$.

Suppose that a plane passes through a point $P_0 = (x_0, y_0, z_0)$ and is simultaneously perpendicular to a vector $\mathbf{v} = A \mathbf{i} + B \mathbf{j} + C \mathbf{k}$ (we assume that $\mathbf{v} \neq \mathbf{0}$).  Then for every point $P = (x,y,z)$ in the plane, the vector $\vec{P_0P}$ connecting these points must be perpendicular to $\mathbf{v}$.  See the figure below.

\begin{center}
\begin{minipage}{.8\textwidth}
\begin{figure}[H]\label{14fig1}
\centering
\includegraphics[width=.9\textwidth]{14fig1.pdf}
\end{figure}
\end{minipage}
\end{center}

\noindent
However, this means that
$$
0 = \mathbf{v}\cdot\vec{P_0 P}   = \langle A,B,C \rangle\cdot \langle x - x_0, y - y_0, z - z_0 \rangle .
$$
Calculating the dot product gives us the following important equation for a plane.

\begin{proposition}
Suppose that a plane passes through $P_0 = (x_0, y_0, z_0)$ and is perpendicular to the vector $\mathbf{v} = A \mathbf{i} + B \mathbf{j} + C \mathbf{k}$.  Then, any point $P = (x,y,z)$ in the plane satisfies the equation
$$
A(x - x_0) + B (y - y_0) + C (z - z_0) = 0,
$$
or equivalently,
$$
Ax + By + Cz = D,
$$
where $D = Ax_0 + By_0 + C z_0$. We call $\mathbf{v}$ the {\bf normal vector} to the plane.
\end{proposition}


\medskip

The procedure above can be reversed in the sense that, given a plane equation $Ax+By+Cz=D$, we can read the normal vector $\mathbf{v}=A\ii+B\jj+C\kk$ from this equation. Hovewer, the normal vector is not unique and any other vector in the same direction would also work. For example, one vector perpendicular to the plane $x+2y+3z=10$ is $\mathbf{v}=\ii+2\jj+3\kk$, and another is $2\mathbf{v}=2\ii+4\jj+6\kk$.

\subsection{Finding the Equation of a Plane in $\mathbb{R}^3$} Let us consider some examples.

\begin{enumerate}
\item{{\it Find the equation of the plane passing through} $P_0 = (2,1,3)$ {\it which is perpendicular to } $\mathbf{v} = \mathbf{i} - 7 \mathbf{k}$.

\bigskip

We are given a point $P_0$ in the plane and the normal vector $\mathbf{v}$.  Using Proposition 1.4.1, the plane is given by the equation
$$
1(x - 2) +0(y-1) - 7(z - 3) = 0.
$$
This simplifies to $ x - 2 - 7z + 21=0$, or $x - 7z = -19$.

\textbf{Note:} in general, in questions asking for the equation of a plane, you do not need to perform the simplification at the end.  We did the calculation here to show you how to move from one form to another. For example, if you need to do some further work with that plane, the simplified form can be easier to use.
}


\bigskip

\item{{\it Find the equation of the plane that passes through the points} $(0,1,-1), (3,0,2)$, $(1,1,0)$.

\bigskip

Here we are not given the normal vector $\mathbf{v}$, so we need to be clever and construct it ourselves.  Let us label the points $P = (0,1,-1), Q = (3,0,2)$,  and $R=(1,1,0)$.  Notice that the vectors $\vec{PQ}$ and $\vec{PR}$ are \textbf{both} contained in the plane (and, in fact, \textbf{span the plane}).  Thus, to find a vector perpendicular to the plane, we construct the cross product of $\vec{PQ}$ and $\vec{PR}$,
\begin{align*}
\mathbf{v} & = \vec{PQ} \times \vec{PR}
=
\begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
3 & -1 & 3 \\
1 & 0 & 1
\end{vmatrix}
=
(-1 + 0) \mathbf{i} - (3 - 3) \mathbf{j} + (0+1) \mathbf{k} \\[1ex]
\quad & = - \mathbf{i} + \mathbf{k}.
\end{align*}
We now use this $\mathbf{v}$ and the provided point $P$ and apply the plane equation to obtain,
$$
0 = - (x-0) + (z+1).
$$
Simplifying, this gives the equation $x - z = 1$.

}

\begin{remark}
We could have used other combinations of the given points to construct our plane equation. For example, we could have used the cross product $\vec{PQ} \times \vec{QR}$ instead of the cross product $\mathbf{v} = \vec{PQ} \times \vec{PR}$. In this situation, we would get either the same equation, or else an \textbf{equivalent} one (such as $-2 x + 2z = -2$ instead of  $x - z = 1$). Check this for yourself!
\end{remark}
\end{enumerate}

\subsection{Lines in $\mathbb{R}^3$} A line in $\mathbb{R}^3$ is determined by a point and a vector parallel to the line. This is the foundation for all line equations in this subsection.

If a line passes through $P_0$ and is parallel to $\mathbf{v}$, then for any point $P$ on the line, we necessarily have $\vec{P_0P} = t \mathbf{v}$ for some $t \in \mathbb{R}$.  This is the \textbf{vector parametric} equation of a line. 


\begin{minipage}{.8\textwidth}
\begin{figure}[H]\label{14fig2}
\centering
\includegraphics[width= .7\textwidth]{14fig2.pdf}
\end{figure}
\end{minipage}


We may rewrite this equation in components.  If $P_0 = (x_0, y_0, z_0)$, $P = (x,y,z)$,  and $\mathbf{v} = \basis{a}{b}{c}$, then
$$
\vecbrack{x - x_0}{y - y_0}{z - z_0} = t \vecbrack{a}{b}{c}.
$$
By comparing the components of the above vector equation, we arrive at the following system of \textbf{scalar parametric equations},
$$
\begin{cases}
x = x_0 + at \\
y = y_0 + bt \\
z = z_0 + ct
\end{cases}
$$
Again, this procedure has a partial converse: if the equation of a line is given in the above form, then this tells us that the vector $a\ii+b\jj+c\kk$ is parallel to the line.

Here's yet another way to view lines. Let $\mathbf{r}_0 = \vec{OP_0} = \vecbrack{x_0}{y_0}{z_0}$ and $\mathbf{r} = \vec{OP} = \vecbrack{x}{y}{z}$.  Then $\vec{P_0P}=\mathbf{r}-\mathbf{r_0}$. Therefore, another way of rewriting the scalar parametric equations is
$$
\mathbf{r} - \mathbf{r}_0 = t \mathbf{v} \Longleftrightarrow \mathbf{r} = \mathbf{r}_0 + t \mathbf{v}
$$

These are the main forms of line equations that we will use, but a line can also be expressed in other ways. For example, a line in $\mathbb{R}^3$ can be written using only two linear equations (as opposed to the three scalar equations listed above).  If $a,b,c$ are all non-zero, we may eliminate the $t$ variable by writing
$$
t = \frac{x - x_0}{a} = \frac{y - y_0}{b} = \frac{z - z_0}{c}.
$$
If (say) $a = 0$, then we have instead
$$
x = x_0; \quad \frac{y - y_0}{b} = \frac{z - z_0}{c}.
$$

\section*{Worked Problems}
\begin{enumerate}[1.]



\item
{\it Find the scalar parametric equations of the line which passes
through the point $(4,5,-2)$ and is perpendicular to the plane
through the three points $P=(1,0,1)$, $Q= (3,2,0)$, $R=(-1,1,2)$.}

\bigskip
The line should be parallel to the normal vector to the plane in question.
For the
normal vector, we will use the cross product of two of the vectors spanned by $P,Q,R$:
$$
{\bf n}=\vec{PQ}\times \vec{PR}
=\langle 2,2,-1\rangle \times \langle -2,1,1\rangle
=\left|\begin{matrix}
{\bf i}&{\bf j}&{\bf k}\\  2&2&-1\\  -2&1&1\\ \end{matrix}\right|
=3{\bf i}+6{\bf k}.
$$
Hence the vector parametric equation is ${\bf r}=(4+3t)\ii+5\jj+(6t-2)\kk$, and the
scalar parametric equations are 
$$x=4+3t,\ \ y=5,\ \ z=6t-2.$$


\bigskip

\item{{\it The planes} $x + y + z = 6$ {\it and } $2x - y - 3z = 0$ {\it intersect in a line.} {\it Find the vector parametric equation of this line}

\bigskip

We need to find a point $P_0$ on the line and a vector $\mathbf{v}$ parallel to the line
in order to have enough information to write our equation.

To find a point,  let us set $z = 0$ in both of our plane equations.  This produces the system of two variable linear equations,
$$
\begin{cases}
x + y = 6 \\
2x - y = 0
\end{cases}
$$
which has the solution $(x_0,y_0) = (2,4)$ (you should verify this!). So, the point $P_0 = (2,4,0)$ lies on our line.

To find a vector,  notice that the two planes are perpendicular to the vectors $\mathbf{u} = \basis{ }{ }{ }$ and $\mathbf{v} = 2\ii-\jj-3\kk$, respectively.  Any vector parallel to their intersection must simultaneously be perpendicular to $\mathbf{u}$ and $\mathbf{v}$. One way to find such a vector is to use the cross product:
\begin{align*}
\mathbf{w} & = \mathbf{u} \times \mathbf{v} =
\begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
1& 1& 1\\
2& -1& -3
\end{vmatrix}
=
(-3+1) \mathbf{i} - (-3 - 2) \mathbf{j} + (-1-2) \mathbf{k} \\[1ex]
\quad & = 
-2\ii+5\jj-3\kk.
\end{align*}
The vector equation is $\mathbf{r} = \vec{OP_0} + t \mathbf{w}$. Substituting our work, this gives
$$
\mathbf{r} = \vecbrack{2}{4}{0} + t \vecbrack{-2}{5}{-3}
$$

\bigskip

\begin{remark}
This is not the only way to solve this problem. For example, the point $(0,9,-3)$ also lies on the intersection line. You would find this point by setting $x = 0$ and solving the corresponding system of equations for $y$ and $z$.  The cross product $\mathbf{v} \times \mathbf{u}$ is also perpendicular to the intersection line.  Using these would give us the equation,
$$
\mathbf{r} = \vecbrack{0}{9}{-3} + t \vecbrack{2}{-5}{3}.
$$
This equation looks different. However, it still describes the same line!

Other methods could also be used, for example we could use linear algebra to solve the system of two linear equations and get a family of solutions for $x,y,z$ depending on a parameter $t$. The advantage of the method used above is that a version of it can be applied to intersections of surfaces more general than planes. We will see it later in this course.
\end{remark}
}

\bigskip

\item
{\it The points $P,Q,R,S$ in ${\mathbb R}^3$ have coordinates $P=(2,0,0)$, $Q=(1,1,0)$, $R=(0,0,1)$,
$S=(1,2,3)$.

\medskip

(a)  Find the area of the triangle $\triangle PQR$.}

\medskip
We have $\vec{PQ} = \langle -1,1,0\rangle$ and $\vec{PR} = \langle -2,0,1\rangle$, so that
$$\vec{PQ} \times \vec{PR} = 
\left|\begin{matrix}
{\bf i} & {\bf j} & {\bf k}\\
-1 & 1 & 0\\
-2 & 0 & 1 \\
            \end{matrix}\right|
 = {\bf i}
 + {\bf j} +2{\bf k}.
 $$
 The area of the triangle is 
$$\frac{1}{2} |\vec{PQ} \times \vec{PR}| = \frac{1}{2} |{\bf i}
 + {\bf j} +2{\bf k}| = \frac{1}{2} \sqrt{6}.
$$

{\it (b) Find the equation (in the form $Ax+By+Cz=D$) of the plane through the points $P,Q,R$.}

\medskip

The plane passes through $P$ and is perpendicular to the vector $\vec{PQ} \times \vec{PR}$ from (a), so
the equation is
$$1 (x-2) +1 (y-0) + 2 (z-0) =0,$$
which simplifies to $x+y+2z=2$.

\medskip

{\it (c) Find the parametric equation of the line which passes through $S$ and is perpendicular to
the plane from (b).}

\medskip

The line passes through $S$ and is parallel to the vector from (a), so the equation is
$$
{\bf r} = \langle 1,2,3 \rangle + t \langle 1,1,2 \rangle.
$$

\bigskip

\item {\it 
Let $P=(2,5,1)$. Find the point $Q$ on the line $x=t+1,y=3t,z=t+3$
which is closest to $P$.}


\medskip

Let $Q=(t+1,3t,t+3)$ be a point on the line, for some $t$ that we need to find. 
For $Q$ to be the closest point to $P$, the vector $\vec{PQ}=\langle t+1-2, 3t-5, t+3-1\rangle 
=\langle t-1 , 3t-5, t+2\rangle 
$ should be perpendicular to the line, hence to its direction vector ${\bf u}=\langle 1,3,1 \rangle$. We
set up the equation for that:
$$
\vec{PQ}\cdot {\bf u}= t-1+(3t-5)\cdot 3 + (t+2)=0,
$$
which simplifies to 
$$t-1+9t-15+t+2=0,\ \ 11t=14, \ \ t=\frac{14}{11}.
$$
Therefore $Q$ has coordinates
$$
x=\frac{14}{11}+1= \frac{25}{11},\ \ 
y= 3\cdot \frac{14}{11} = \frac{42 }{11},\ \ 
z= \frac{14}{11}+ 3 =   \frac{47}{11}.
$$

\end{enumerate}

\section*{Practice Problems}

\begin{enumerate}[1.]
\item Give an example of a line parallel to the plane $x+y+z=0$ but not contained in that plane. Give the equation of the
line in the vector parametric form ${\bf r}={\bf a} +t{\bf v}$.

\bigskip

\item The points $P,Q,R$ in ${\mathbb R}^3$ have coordinates $P=(1,1,-1)$, $Q=(2,-1,0)$, $R=(2,3,4)$.
\medskip


(a) Find the area of the triangle $\triangle PQR$.

\medskip

(b)
Find the angle at $P$ in the triangle $\triangle PQR$. (An answer in the form $\cos^{-1}(\cdot)$ 
or $\sin^{-1}(\cdot)$ is sufficient.)


\medskip

(c) Find the equation (in the form $Ax+By+Cz=D$) of the plane through the points $P,Q,R$.

\bigskip

\item Prove that the line $x=t+1,y=3t,z=t+3$ is parallel to the plane $4x-y-z=2$.


\bigskip

\item Find the equation (in the form $Ax+By+Cz=D$) of the plane that contains the line $x=t+1,y=3t,z=t+3$ and is perpendicular to the plane $4x-y-z=2$.

\bigskip

\item Find the equation of the plane that contains the line $x=t, y=2t, z=0$, and the point $(3,-1,-1)$.


\bigskip

\item { 
Write the vector ${\bf w}=\ii-\jj+4 \kk$ as a sum of two vectors ${\bf w}={\bf u}+{\bf v}$ such that
${\bf u}$ is parallel to the plane $x+2y-2z=0$ and the other is perpendicular to it.}


\bigskip

\item { 
Find the equations (in whichever form you prefer) of the line 
of intersection of the planes $3x-y+z=2$ and $x+2y-z=-4$.}


\bigskip



\item {
Find vectors {\bf a}, {\bf b}, {\bf c} in $\rr^2$ such that the 
set of points whose position vector ${\bf r}$ satisfies the inequalities
\begin{equation}\label{e1}
{\bf r}\cdot {\bf a}\leq 1,\ {\bf r}\cdot {\bf b}\leq 1,\ {\bf r}\cdot {\bf c}\leq 1
\end{equation}
is the triangle with vertices $(1,2)$, $(2,-2)$, $(-3,0)$.}


\bigskip

\item 
Let ${\bf v}$ and ${\bf w}$ be two nonzero vectors in $\rr^3$ that are perpendicular to each other. Prove that the set
$$
\{P=(x,y,z)\in\rr^3:\ \vec{OP}\times {\bf v}={\bf w}\}
$$
is a line.


\end{enumerate}





