Distance between two straight lines in space

The distance between two straight lines r and r, d(r,r), is the minimal distance between any point of r and any other point of r.

  • If the straight lines coincide or are secant, the distance between them is zero, d(r,r)=0.
  • If the straight lines are parallel, the distance between them can be calculated at any point of one of the lines, Pr or Pr, and finding the distance to the other straight line: d(r,r)=d(P,r)=d(r,P)
  • If the straight lines cross, the following general formula is deduced to calculate the distance between them:

    We take a point A belonging to r and another point A belonging to r. Let v and v be the governing vectors of r and r. We join the points A and A. The volume of the parallelepiped determined by AA, v and v, is the absolute value of the mixed product of these vectors: vp=|[AA,v,v]|

    On the other hand we can also calculate this volume by multiplying the area of the base and the height: vp=|v×v|d(r,r)|

    Therefore: d(r,r)=|[AA,v,v]||v×v|

Example

We are going to calculate the distance between the straight lines: r:x2=y+32=zr:x=y=z

First we determine its relative position. To do it we must write the implicit equations of the straight line: r:{2xy7=0xz2=0r:{xy=0xz=0

And we calculate the rank of the matrix of the resulting systems of equations: |M|=|2107101211001010|=20

Therefore rank(M)=4 and the two straight lines intersect. Now we must find a point and the governing vector of each line.

For the straight line r: A=(2,3,0) and v=(1,2,1).

For the straight line r: A=(0,0,0) and v=(1,1,1).

So we have: AA=(2,3,0)

|v×v|=||ijk121111||=|2i+j+k2kji|=|ik|=|(1,0,1)|=12+02+(1)2=2

[AA,v,v]=|230121111|=4+3+23=2

Finally: d(r,r)=|[AA,v,v]||v×v|=|2|2=2