Advanced Math/Distance between lines.
Expert: Paul Klarreich - 12/25/2009
QuestionQUESTION: Hello!
I've the following two lines: L(1): z=y-c; L(2): z=c-x. My question is, how to find the shortest distance between these lines?
thank you
ANSWER: Are you sure these are lines? They look like planes to me.
---------- FOLLOW-UP ----------
QUESTION: Oh yes, sorry, so L(1) line lies on the yz plan (x=0), and L(2) line lies on the xz plan (y=0). Hope it's correct now, and you can help me!
Thanks
AnswerQuestioner: grull
Country: Hungary
Category: Advanced Math
Private: Yes
Subject: skew lines??
Question: QUESTION: Hello!
I've the following two lines: L(1): z=y-c; L(2): z=c-x. My question is, how to find the shortest distance between these lines?
thank you
ANSWER: Are you sure these are lines? They look like planes to me.
---------- FOLLOW-UP ----------
QUESTION: Oh yes, sorry, so L(1) line lies on the yz plan (x=0), and L(2) line lies on the xz plan (y=0). Hope it's correct now, and you can help me!
Thanks
L1: z = y - c, x = 0, so:
<x,y,z> = <0,0,-c> + t<0,1,1>
L2: z = c - x, y = 0, so:
<x,y,z> = <0,0,c> + s<1,0,-1>
If P1 and P2 are points on their lines, their distance(squared) is:
M = (x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2
M = (s)^2 + (t)^2 + ((t-c)-(c-s)^2
M = s^2 + t^2 + ((t + s - 2c)^2
M = s^2 + t^2 + t^2 + s^2 - 4ct - 4cs + 2st + 4c^2
M = 2s^2 + 2t^2 - 4ct - 4cs + 2st + 4c^2
Now you want to minimize that; find
dM/ds and dM/dt
and set them equal to zero.
I think you get :
t = 2c/3
s = 2c/3
That is it -- now plug in and find your distance.