The point-line distance in three dimensions is the shortest distance from a point
to a line. Let a line in three
dimensions be specified by two distinct points
and
lying on it. The coordinates of a general point
on the line are given by
|
(1)
|
The squared distance between a point on the line with parameter
and a point
is therefore
|
(2)
|
To minimize the distance, set and solve for
to obtain
|
(3)
|
where
denotes the dot product. The minimum distance can then be found by plugging
back into (2) to obtain
|
(4)
| |
|
(5)
| |
|
(6)
|
Using the vector quadruple product
|
(7)
|
where
denotes the cross product then gives
|
(8)
|
and taking the square root results in the beautiful formula
|
(9)
| |||
|
(10)
|
Here, the numerator is simply twice the area of the triangle formed by points ,
,
and
,
and the denominator is the length
of one of the bases of the triangle,
which follows since, from the usual triangle area
formula,
.