# Shortest distance between two lines

1. May 4, 2010

### Anden

I'm a bit uncertain about this question and would like some help, as I don't have the correct answer. Have I done this correctly?

1. The problem statement, all variables and given/known data
What is the shortest distance between the two lines A = (1,2,3) + t(0,1,1) and B = (1,1,1) + s(2,3,1)

3. The attempt at a solution
My reasoning: The vector AB is shortest when AB is orthogonal to BOTH A and B.

Therefore the scalar product AB $$\circ$$ A = AB $$\circ$$ B = 0. That gives a system with two equations

AB = (2s, -1+3s-t, -2+s-t)

AB $$\circ$$ A = -3+4s-2t=0
AB $$\circ$$ B = 14s-5-4t=0

which when solved gives s = -1/6 and t = -11/6.

I now seek |AB|, or the LENGTH of the vector.

Substituting s and t with the corresponding values and then using Pythagoras gives:

|AB| = sqrt(1/3)

Is this correct? Is there perhaps an easier way to do this?

Danke schön!

2. May 4, 2010

### LCKurtz

Yes, your method is correct. Another approach that doesn't involve simultaneous equations is to cross the two direction vectors and make a unit normal n from it. That gives the orthogonal direction. Then let V be a vector from a point on one line to a point on the other.

Then d = |V dot n|

3. May 4, 2010

### Anden

Worked excellent, thank you. I also noticed that I could use the normal vector without turning it into a unit vector. I used it to create a system of equations
1+2s=1-2a
1+3s=2+t+2a
1+s=3+t-2a
which gives that a = 1/6

Then I multiplied that(1/6) with (-2,2,-2) and then used Pythagoras to calculate the length of the vector, which in this case is 1/sqrt(3).

4. May 10, 2010

### Jokerhelper

or you could use projection