Associated Topics || Dr. Math Home || Search Dr. Math

### Distance Between 2 Lines: Vectors

```
Date: 8/19/96 at 23:29:28
From: Anonymous
Subject: Shortest Distance...

What is the shortest distance between 2 lines?
```

```
Date: 8/20/96 at 8:16:26
From: Doctor Anthony
Subject: Re: Shortest Distance...

I am not sure how much vector work you have done, but I will assume a
knowledge of scalar products of vectors, and the vector equation of
straight lines.

In 3D space the shortest distance between two skew lines is in the
direction of the common perpendicular. (There is one and only one such
direction, as can be seen if you move one line parallel to itself
until it intersects the other line. These two lines would now define a
plane, and the perpendicular to this plane is the direction of the
common perpendicular).

You now take any point on one line, and any point on the other line,
and write down the vector joining these two points.  Finally you find
the component of this vector in the direction of the common
perpendicular.  This is done by finding the scalar product of the
vector with the UNIT vector in the direction of the common
perpendicular.  The result of the scalar product is the shortest
distance you require.

I will illustrate the method by means of an example.

Find the shortest distance between the lines:

x/1 = (y-3)/1 = z/(-1)

(x-5)/3 = (y-8)/7 = (z-2)/(-1)

First we require the vector perpendicular to both (1,1,-1) and
(3,7,-1)

Let the common perpendicular be (p,q,r). The scalar product of this
with both (1,1.-1) and (3,7,-1) will be zero, so:

p+q-r = 0 and 3p+7q-r = 0

Note that although there are apparently 3 unknowns and only two
equations, these are homogeneous equations (having 0 on the right hand
side), so we could find values of p/r and q/r and hence the ratios
p:q:r which is all that we require.  Using the determinant method for
solving, we have:

p       -q          r
------ = -------  =  ------
|1  -1|   |1  -1|     |1   1|
|7  -1|   |3  -1|     |3   7|

p/6  =  -q/2    =   r/4

p/3  =  q/-1    =   r/2   and so  p:q:r = 3:-1:2

So the common perpendicular is the vector (3,-1,2)

As a UNIT vector this is (1/sqrt(14)){3,-1,2}

Next we have point (0,3,0) on line (1) and (5,8,2) on line (2).
The vector joining these points is (5,5,2)  and now scalar product
this with the unit vector of the common perpendicular.

Scalar product = (1/(sqrt(14)){5*3 + 5*(-1) + 2*2}
= (1/sqrt(14)){15 - 5 + 4}
= 14/sqrt(14)
= sqrt(14)

and this is the shortest distance required.

-Doctor Anthony,  The Math Forum
Check out our web site!  http://mathforum.org/dr.math/
```
Associated Topics:
High School Geometry
High School Higher-Dimensional Geometry
High School Linear Algebra

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search