# Shortest Distance between line and a point

L is the Line with parametric equation:

x=2-t
y=-4+t
z=-2-t


Find the shortest distance d from point =(3,1,1) to L and point Q on L that is closest to the point.

for the distance I get: (((t+5)^2)+((t+5)^2)+((t+3)^2))^(1/2)

I'm not sure if this is right for the distance.

• How did you get this answer? Please write out your proof. Mar 18, 2019 at 3:55
• You have written down the square of the distance from the given point to an arbitrary point on the line (except that $3-2\ne5$), but what's wanted is the distance to the closest point on the line. Mar 18, 2019 at 3:56

There's probably a much easier way to solve this, but we have the line $$L = \langle(2-t), (-4+t), (-2-t)\rangle$$ and the point $$P=(3,1,1)$$. The distance at any time $$t$$ between said line and point is $$D=\sqrt{(t+1)^2+(5-t)^2+(3+t)^2}$$ Minimizing the distance is the same as minimizing the square of the distance (this can be simply explained: distance is always positive). $$D_2=(t+1)^2+(5-t)^2+(3+t)^2$$ $$(D_2)'=2(t+1)-2(5-t)+2(3+t)$$ The distance is minimized when the derivative is $$0$$. $$0=2t+2-10+2t+6+2t$$ $$0=6t-2$$ $$t=\frac13$$ So, at time $$t=\frac13$$, $$\,L(\frac13)=\langle \frac53,-\frac{11}3,-\frac73\rangle$$ And the distance $$D$$ is (once you plug and chug) $$\frac{53}9$$
The line is parallel to $$u=\langle-1,1,-1\rangle$$.
A point on the line is $$(2,-4,-2)$$.
The vector from that point to $$(3,1,1)$$ is $$v=\langle1,5,3\rangle$$.
Picture these two vectors $$u$$ and $$v$$. If you orthogonally project $$v$$ onto the span of $$u$$, you get to the nearest point that you are hunting (relative to the base point $$(2,-4,-2)$$). To project, $$\operatorname{proj}_{u}v=\frac{u\cdot v}{u\cdot u}u=\frac{1}{3}\langle-1,1,-1\rangle$$ Now add this to $$(2,-4,-2)$$ and you have the closest point: $$\left(\frac53,-\frac{11}{3},-\frac73\right)$$