Point-Line Distance--3-Dimensional
Let a line in three dimensions be specified by two points x_1=(x_1,y_1,z_1) and x_2=(x_2,y_2,z_2) lying on it, so a vector along the line is given by
The squared distance between a point on the line with parameter t and a point x_0=(x_0,y_0,z_0) is therefore
d^2=[(x_1-x_0)+(x_2-x_1)t]^2+[(y_1-y_0)+(y_2-y_1)t]^2+[(z_1-z_0)+(z_2-z_1)t]^2. |
(2)
|
To minimize the distance, set d(d^2)/dt=0 and solve for t to obtain
where · denotes the dot product. The minimum distance can then be found by plugging t back into (2) to obtain
Using the vector quadruple product
(AxB)^2=A^2B^2-(A·B)^2 |
(7)
|
where x denotes the cross product then gives
and taking the square root results in the beautiful formula
Here, the numerator is simply twice the area of the triangle formed by points x_0, x_1, and x_2, and the denominator is the length of one of the bases of the triangle, which follows since, from the usual triangle area formula, Delta=bd/2.
See also
Collinear, Line, Point, Point-Line Distance--2-Dimensional, Triangle AreaExplore with Wolfram|Alpha
More things to try:
Cite this as:
Weisstein, Eric W. "Point-Line Distance--3-Dimensional." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html