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}](p2_809.gif) |
(1) |
The distance between a point on the line with parameter
and the point
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}](p2_810.gif) |
(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}](p2_811.gif) |
(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}](p2_812.gif) |
(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}](p2_813.gif) |
(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