What is the distance between the line (x+1)/7=(y+1)/6=(z+1)/1 and the line (x-3)/1=(y-5)/(-2)=(z-7)/1 ?

3 Answers
Mar 8, 2017

Shortest distance: 2 sqrt 2

Explanation:

Your 2 lines are:

mathbf l_1: (x+1)/7=(y+1)/6=z+1 qquad [ = p]

mathbf l_2: x-3=(y-5)/-2=z-7 qquad [ = q]

We can write these in parameterised form:

mathbf l_1: ((x),(y),(z)) = ((-1),(-1),(-1)) + p ((7),(6),(1))

mathbf l_2: ((x),(y),(z)) = ((3),(5),(7)) + q ((1),(-2),(1))

If the line connecting the points on the shortest distance touches mathbf l_1 and mathbf l_2, respectively at points A and B, then we can say, using the distance formula, that the square of the distance between these points A and B is:

s^2 = S = (-1 + 7p - 3- q)^2 + (- 1 + 6p - 5 + 2 q)^2 + (- 1 + 7p - 7 - q)^2

= (-4 + 7p - q)^2 + (- 6 + 6p + 2 q)^2 + (- 8 + 7p - q)^2

Assuming you can use calculus, we can take partial differentials in order to looks for any critical points:

(partial S)/(partial p) = 2(-4 + 7p - q) cdot 7 + 2(- 6 + 6p + 2 q) cdot 6 + 2(- 8 + 7p - q) cdot 7

= 4 (67 p - q - 60) = 0 qquad triangle

(partial S)/(partial q) = 2(-4 + 7p - q) cdot (-1) + 2 (- 6 + 6p + 2 q) cdot 2 + 2 (- 8 + 7p - q) cdot (-1)

= -4(p - 3q) = 0 qquad square

square is fortutious because we see that for a critical point p = 3q. We can sub that straight into triangle to get:

4 (67 (3q) - q - 60) = 0

implies q = 3/10, implies p = 9/10, implies S = 8

The shortest distance is therefore: s = 2 sqrt 2

We could now check the nature of the critical point via the second derivative but, but from a practical perspective, these are skew lines. The CP must be a min.

I might post a non-calculus approach later if i get time. There, we would use the cross product and algebra.

Mar 9, 2017

I make it 82/25sqrt(5).

Explanation:

Line 1:

t_1 = (x+1)/7=(y+1)/6=(z+1)/1

That is:

(x, y, z) = (7t_1-1, 6t_1-1, t_1-1)

color(white)((x, y, z)) = (-1, -1, -1) + t_1(7, 6, 1)

Line 2:

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

That is:

(x, y, z) = (t_2+3, -2t_2+5, t_2+7)

color(white)((x, y, z)) = (3,5,7) + t_2(1, -2, 1)

A line through the points of closest approach of these two lines is perpendicular to both of these lines, so has the same direction as the cross product of (7, 6, 1) and (1, -2, 1):

(7, 6, 1) xx (1, -2, 1) = abs((i, j, k),(7, 6, 1),(1, -2, 1))

color(white)((7, 6, 1) xx (1, -2, 1)) = (abs((6, 1),(-2, 1)), abs((1, 7),(1, 1)), abs((7, 6),(1, -2)))

color(white)((7, 6, 1) xx (1, -2, 1)) = (8, -6, -20)

So we want to find t_1, t_2, t_3 such that:

(-1, -1, -1) + t_1(7, 6, 1) + t_3(8, -6, -20) = (3, 5, 7) + t_2(1, -2, 1)

Adding (1, 1, 1) + t_2(-1, 2, -1) to both sides, this becomes:

t_1(7, 6, 1) + t_2(-1, 2, -1) + t_3(8, -6, -20) = (4, 6, 8)

Which we can rewrite as:

((7, -1, 8),(6, 2, -6),(1,-1,-20))((t_1),(t_2),(t_3)) = ((4),(6),(8))

Rewrite as an augmented matrix:

((7, -1, 8, |, 4),(6, 2, -6, |, 6),(1,-1,-20, |, 8))

Perform a sequence of row operations to make the left hand side of this matrix into a 3xx3 identity matrix.

((7, -1, 8, |, 4),(6, 2, -6, |, 6),(1,-1,-20, |, 8)) ->

((1, -3, 14, |, -2),(6, 2, -6, |, 6),(1,-1,-20, |, 8)) ->

((1, -3, 14, |, -2),(3, 1, -3, |, 3),(1,-1,-20, |, 8)) ->

((1, -3, 14, |, -2),(0, 10, -45, |, 9),(0,2,-34, |, 10)) ->

((1, -3, 14, |, -2),(0, 1, -9/2, |, 9/10),(0,1,-17, |, 5)) ->

((1, -3, 14, |, -2),(0, 1, -9/2, |, 9/10),(0,0, -25/2, |, 41/10)) ->

((1, -3, 14, |, -2),(0, 1, -9/2, |, 9/10),(0,0, 1, |, -41/125)) ->

((1, 0, 1/2, |, 7/10),(0, 1, -9/2, |, 9/10),(0,0, 1, |, -41/125)) ->

((1, 0, 0, |, 108/125),(0, 1, 0, |, -72/125),(0,0, 1, |, -41/125))

Hence:

{ (t_1 = 108/125), (t_2 = -72/125), (t_3 = -41/125) :}

So the two points of closest approach are:

(-1, -1, -1) + t_1(7, 6, 1) = (-1, -1, -1) + 108/125(7, 6, 1)

color(white)((-1, -1, -1) + t_1(7, 6, 1)) = (631/125, 523/125, -17/125)

(3,5,7) + t_2(1, -2, 1) = (3,5,7) - 72/125(1, -2, 1)

color(white)((3,5,7) + t_2(1, -2, 1)) = (303/125, 769/125, 803/125)

The distance between these two points is:

1/125 sqrt((303-631)^2 + (769-523)^2+(803+17)^2)

= 1/125sqrt(107584+60516+672400)

= 1/125sqrt(840500)

= 1/125*410sqrt(5)

= 82/25sqrt(5)

Mar 9, 2017

82/25 sqrt(5)

Explanation:

lambda_1=(x+1)/7=(y+1)/6=(z+1)/1

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

{(x=-1+7lambda_1),(y=-1+6lambda_1),(z=-1+lambda_1):}->p=p_1+lambda_1 v_1

{(x=3+lambda_2),(y=5-2lambda_2),(z=7+lambda_2):}->p = p_2+lambda_2 v_2

Now the distance between the two lines is

d(lambda_1,lambda_2)=norm(p_1+lambda_1 v_1-p_2-lambda_2 v_2)

but

d^2(lambda_1,lambda_2)=norm(p_1-p_2)^2+lambda_1^2norm (v_1)^2+lambda_2^2norm(v_2)^2+2lambda_1 << p_1-p_2,v_1 >>-2lambda_2 << p_1-p_2,v_2 >>-2lambda_1lambda_2 << v_1, v_2 >>

The minimum of d^2(lambda_1,lambda_2) is located at the solution of

{(partial/(partial lambda_1) d^2 = 0 ),(partial/(partial lambda_2) d^2 = 0):}

which is obtained solving the linear system

((-norm(v_1)^2, << v_1,v_2>>),(- << v_1,v_2>>, norm(v_2)^2))((lambda_1),(lambda_2)) = ((<< p_1-p_2,v_1 >>),(<< p_1-p_2, v_2 >>))

Solving for lambda_1,lambda_2 we obtain

lambda_1 = 108/125, lambda_2 = -72/125

which substituted into d(lambda_1,lambda_2) = 82/25 sqrt(5)