info prev up next book cdrom email home

Point-Line Distance--3-D

A line in 3-D is given by the parametric Vector

\begin{displaymath}
{\bf v}=\left[{\matrix{x_0+at\cr y_0+bt\cr z_0+ct\cr}}\right].
\end{displaymath} (1)

The distance between a point on the line with parameter $t$ and the point $(x_1, y_1, z_1)$ is therefore
\begin{displaymath}
r^2=(x_1-x_0-at)^2+(y_1-y_0-bt)^2+(z_1-z_0-ct)^2.
\end{displaymath} (2)

To minimize the distance, take


\begin{displaymath}
{\partial (r^2)\over \partial t} = -2a(x_1-x_0-at)-2b(y_1-y_0-bt) -2c(z_1-z_0-ct) = 0
\end{displaymath} (3)


\begin{displaymath}
a(x_1-x_0)+b(y_1-y_0)+c(z_1-z_0)-t(a^2+b^2+c^2)=0
\end{displaymath} (4)


\begin{displaymath}
t={a(x_1-x_0)+b(y_1-y_0)+c(z_1-z_0)\over a^2+b^2+c^2},
\end{displaymath} (5)

so the minimum distance is found by plugging (5) into (2) and taking the Square Root.

See also Line, Point, Point-Line Distance--2-D




© 1996-9 Eric W. Weisstein
1999-05-25