karush said:
sorry this looks like duplicate post done much earlier
somehow it never got recorded on the HW
mod can delete :(
Yes, this is a duplicate of the thread posted here:
http://mathhelpboards.com/calculus-10/231-12-3-65-determine-smallest-distance-between-point-line-22060.html
The method used there was what I had in mind for finding the required distance.
However, let's take this opportunity to develop a general formula. Suppose we have a line described by the two points:
$$P_1\left(x_1,y_1,z_1\right),\,P_2\left(x_2,y_2,z_2\right)$$
And the point:
$$P_0\left(x_0,y_0,z_0\right)$$
And so a vector along the line can be given as:
$$\left[\begin{array}{c}x_1+\left(x_2-x_1\right)t \\ y_1+\left(y_2-y_1\right)t \\ z_1+\left(z_2-z_1\right)t \end{array}\right]$$
And thus, the square of the distance $D$ between a point on the line with parameter $t$ and the given point is:
$$f(t)=D^2(t)=\left(\left(x_1-x_0\right)+\left(x_2-x_1\right)t\right)^2+\left(\left(y_1-y_0\right)+\left(y_2-y_1\right)t\right)^2+\left(\left(z_1-z_0\right)+\left(z_2-z_1\right)t\right)^2$$
Expanding, we get:
$$f(t)=\left(\left(x_1-x_0\right)^2+\left(y_1-y_0\right)^2+\left(z_1-z_0\right)^2\right)+2\left(\left(x_1-x_0\right)\left(x_2-x_1\right)+\left(y_1-y_0\right)\left(y_2-y_1\right)+\left(z_1-z_0\right)\left(z_2-z_1\right)\right)t+\left(\left(x_2-x_1\right)^2+\left(y_2-y_1\right)^2+\left(z_2-z_1\right)^2\right)t^2$$
Using vector notation, this becomes:
$$f(t)=\left|\vec{P_1}-\vec{P_0}\right|^2+2\left(\vec{P_1}-\vec{P_0}\right)\cdot\left(\vec{P_2}-\vec{P_1}\right)t+\left|\vec{P_2}-\vec{P_1}\right|^2t^2$$
Differentiating w.r.t $t$ and equating the result to 0 and solving for $t$, we find:
$$t=-\frac{\left(\vec{P_1}-\vec{P_0}\right)\cdot\left(\vec{P_2}-\vec{P_1}\right)}{\left|\vec{P_2}-\vec{P_1}\right|^2}$$
Observing that $f$ is a parabolic function opening upwards, we can then state:
$$f_{\min}=f\left(-\frac{\left(\vec{P_1}-\vec{P_0}\right)\cdot\left(\vec{P_2}-\vec{P_1}\right)}{\left|\vec{P_2}-\vec{P_1}\right|^2}\right)=\left|\vec{P_1}-\vec{P_0}\right|^2-\frac{\left(\left(\vec{P_1}-\vec{P_0}\right)\cdot\left(\vec{P_2}-\vec{P_1}\right)\right)^2}{\left|\vec{P_2}-\vec{P_1}\right|^2}$$
$$f_{\min}=\frac{\left|\vec{P_1}-\vec{P_0}\right|^2\left|\vec{P_2}-\vec{P_1}\right|^2-\left(\left(\vec{P_1}-\vec{P_0}\right)\cdot\left(\vec{P_2}-\vec{P_1}\right)\right)^2}{\left|\vec{P_2}-\vec{P_1}\right|^2}$$
Using the vector quadruple product, we may write:
$$f_{\min}=\left(\frac{\left|\left(\vec{P_2}-\vec{P_1}\right)\times\left(\vec{P_1}-\vec{P_0}\right)\right|}{\left|\vec{P_2}-\vec{P_1}\right|}\right)^2$$
Hence:
$$D_{\min}=\frac{\left|\left(\vec{P_2}-\vec{P_1}\right)\times\left(\vec{P_1}-\vec{P_0}\right)\right|}{\left|\vec{P_2}-\vec{P_1}\right|}$$
Now, in the given problem, we may take:
$$\vec{P_0}=\langle 1,1,1 \rangle$$
$$\vec{P_1}=\langle 0,0,0 \rangle$$
$$\vec{P_2}=\langle -4,-5,8 \rangle$$
And so we have:
$$\vec{P_2}-\vec{P_1}=\langle -4,-5,8 \rangle$$
$$\vec{P_1}-\vec{P_0}=\langle -1,-1,-1 \rangle$$
And we then find:
$$\left(\vec{P_2}-\vec{P_1}\right)\times\left(\vec{P_1}-\vec{P_0}\right)=\langle 13,-12,-1 \rangle$$
So, we have:
$$D_{\min}=\sqrt{\frac{13^2+12^2+1^2}{4^2+5^2+8^2}}=\sqrt{\frac{314}{105}}\quad\checkmark$$