Distance from point to line in three dimensions

calculusmultivariable-calculusvectors

Say the equation of a line is given by the parametric equations $x=x(t), y=y(t), z=z(t)$, then
$$r(t)=x(t)\vec{i}+y(t)\vec{j}+z(t)\vec{k}$$
can be reduced to $$r(t)=r_0+t \begin{bmatrix} a \\ b \\ c\end{bmatrix}$$
where $r_0$ is the initial point the line passes through and the vector with components $a,b,c$ is direction vector of $r$.
Now I want to find the shortest distance $d$ from the line to the point $P_1(x_1, y_1, z_1)$ outside of this line. I'm able to find the direction vector of $d$, which I think is $\begin{bmatrix} x_1-x_0 \\ y_1-y_0 \\ z_1-z_0 \end{bmatrix}$ but I'm not able to take it any further to find $\Vert d\Vert$.

Best Answer

The distance from the point $(x_1, y_1, z_1)$ to an arbitrary point of the line satisfies $$ D^2 = (x_1-x(t))^2 + (y_1-y(t))^2 + (z_1-z(t))^2$$

You want to minimize this function.

Take the derivative with respect to $t$ and let the derivative equal zero to find the $t$ which gives you the shortest distance.

Related Question