Let \(A(2, -1, 1)\) be a point in \(\R^3\text{.}\) Suppose line \(l\) is given by parametric equations
\begin{equation*}
x=t+3
\end{equation*}
\begin{equation*}
y=-t+1
\end{equation*}
\begin{equation*}
z=t-2
\end{equation*}
Find the distance from \(A\) to \(l\text{.}\)
We will first construct a vector \(\mathbf{v}\) by picking an arbitrary point \(B\) on \(l\) to be the tail of \(\mathbf{v}\) and using point \(A\) as the head of \(\mathbf{v}\text{.}\) An easy point to choose on line \(l\) is the point \((3, 1, -2)\) that corresponds to \(t=0\text{.}\) Now we have
\begin{equation*}
\mathbf{v}=\overrightarrow{BA}=\begin{bmatrix}2-3\\-1-1\\1-(-2)\end{bmatrix}=\begin{bmatrix}-1\\-2\\3\end{bmatrix}
\end{equation*}
The line has a direction vector
\begin{equation*}
\mathbf{d}=\begin{bmatrix}1\\-1\\1\end{bmatrix}
\end{equation*}
We will now find the projection of \(\overrightarrow{BA}\) onto \(l\)
\begin{equation*}
\text{proj}_{\mathbf{d}} \overrightarrow{BA}=\left(\frac{\mathbf{v}\cdot\mathbf{d}}{\norm{\mathbf{d}}^2}\right)\mathbf{d}=\frac{4}{3}\begin{bmatrix}1\\-1\\1\end{bmatrix}=\begin{bmatrix}4/3\\-4/3\\4/3\end{bmatrix}
\end{equation*}
Next, we find \(\mathbf{v}_{\perp}\text{.}\)
\begin{equation*}
\mathbf{v}_{\perp}=\mathbf{v}-\mathbf{v}_{\parallel}=\begin{bmatrix}-1\\-2\\3\end{bmatrix}-\begin{bmatrix}4/3\\-4/3\\4/3\end{bmatrix}=\begin{bmatrix}-7/3\\-2/3\\5/3\end{bmatrix}
\end{equation*}
Finally, to find the distance between point \(A\) and line \(l\text{,}\) we find the magnitude of \(\mathbf{v}_{\perp}\text{.}\)
\begin{equation*}
\norm{\mathbf{v}_{\perp}}=\frac{1}{3}\sqrt{49+4+25}=\frac{\sqrt{78}}{3}
\end{equation*}