information:highlighting
Distance

The nearest points c 1 {\displaystyle \mathbf {c_{1}} } and c 2 {\displaystyle \mathbf {c_{2}} } form the shortest line segment joining Line 1 and Line 2:

The distance between nearest points in two skew lines may also be expressed using other vectors:

Here the 1×3 vector x represents an arbitrary point on the line through particular point a with b representing the direction of the line and with the value of the real number λ {\displaystyle \lambda } determining where the point is on the line, and similarly for arbitrary point y on the line through particular point c in direction d.

The cross product of b and d is perpendicular to the lines, as is the unit vector

The perpendicular distance between the lines is then

(if | b × d | is zero the lines are parallel and this method cannot be used).