Find the shortest distance between the point $(8,3,2)$ and the line through the points $(1,2,1)$ and $(0,4,0)$ "Find the shortest distance between the point $(8,3,2)$ and the line through the points $(1,2,1)$ and $(0,4,0)$"
$$P = (1,2,1), Q = (0,4,0), A = (8,3,2)$$
$OP$ = vector to $P$
$$PQ_ = (0,4,0) - (1,2,1)$$
I found that the equation of the line $L$ that passes through $(1,2,1)$ and $(0,4,0)$ is: 
$$L = OP + PQ \, t;$$
$$L = (1,2,1) + (-1,2,-1) \, t .$$
However after this I'm not sure how to proceed. I can find PA_ then draw a line from $A$ to the line $L$... advice?
 A: The shortest distance should intuitively be the length of the segment which connects our point to our line and forms a right angle. Consider that we can determine this first by determining a vector from a point on our line to $A$ followed by finding its projection onto $\vec{PQ}$; the orthogonal part is then just the difference between this vector and our original vector from our line to our point and its magnitude yields the length of said segment:$$d=\left\|\vec{AP}-\frac{\vec{AP}\cdot\vec{PQ}}{\|\vec{PQ}\|^2}\vec{PQ}\right\|$$
A: The equation of the plane passing through the points $P$, $Q$, and $A$ is given by
$\begin{vmatrix}
x & y & z & 1 \\ 
1 & 2 & 1 & 1 \\ 
0 & 4 & 0 & 1 \\ 
8 & 3 & 2 & 1 
\end{vmatrix}=0$.
After you compute the determinant, you get $3x-6y-15z+24=0$. Then the area $S$ of the triangle defined by the points is given by $S=\frac{1}{2}\sqrt{3^2+(-6)^2+(-15)^2}=\frac{1}{2}\sqrt{270}$. The area also satisfies $S=\tfrac{1}{2}hb$, where the height $h$ is measured from $A$ to the base $b$ connecting $P$ and $Q$. So $h=2S/b$ where $b=\sqrt{(1-0)^2+(2-4)^2+(1-0)^2}=\sqrt{6}$ is the distance from $P$ to $Q$. So, you get $h=\sqrt{270}/\sqrt{6}=3\sqrt{5}$, which is the shortest distance from $A$ to the line passing through $P$ and $Q$. 
A: Any point on the line looks like
$\vec{\rm r}\left(\lambda\right) \equiv \vec{P} + \lambda\vec{n}$ where
$\lambda \in {\mathbb R}$ and $\vec{n} \equiv \vec{Q} - \vec{P}$. The distance
between the point $\vec{A}$ and the point $\vec{\rm r}\left(\lambda\right)$ is given by
${\rm d}\left(\lambda\right)
=
\left\vert\vec{\rm r}\left(\lambda\right) - \vec{A}\right\vert
=
\left\vert\lambda\,\vec{n} + \vec{P} - \vec{A}\right\vert$. So, you have to minimize
\begin{align}
{\rm d}^{2}\left(\lambda\right)
=&
\lambda^{2} + 2\vec{n}\cdot\left(\vec{P} - \vec{A}\right)\,\lambda
+
\left(\vec{P} - \vec{A}\right)^{2}
=
\left\lbrack\lambda + \vec{n}\cdot\left(\vec{P} - \vec{A}\right)\right\rbrack^{2}
+
\left(\vec{P} - \vec{A}\right)^{2}
-
\left\lbrack\vec{n}\cdot\left(\vec{P} - \vec{A}\right)\right\rbrack^{2} 
\end{align}
Then the shortest distance is given by
$${\large\sqrt{%
\left(\vec{P} - \vec{A}\right)^{2}
-
\left\lbrack\vec{n}\cdot\left(\vec{P} - \vec{A}\right)\right\rbrack^{2}}} 
$$
A: Here is an approach, we have $P = (1,2,1), Q = (0,4,0), A = (8,3,2)$
1) Construct a vector $u=AP$
2) Construct a vector $v=AQ$
3) Find the projection $p$ of $u$ on $v$
4) Construct the vector $w = \frac {p}{||v||}v$
5) Construct the vector $d=u-w$ which its norm ||d|| gives the desired result.   
