1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Shortest distance between two lines

  1. Jun 5, 2009 #1
    Hi guys this problem should be simple enough but I just cant get the correct answer. Well the question is:

    Show that the shortest distance between the line ([itex]l_1[/itex]) with equation

    [tex]\frac{x+4}{3} = \frac{y-3}{2} = \frac{z+6}{5}[/tex]

    and the line ([itex]l_2[/itex]) with equations

    i. [tex] x -2y -z =0[/tex]

    ii. [tex]x -10y -3z =-7[/tex]

    is [itex]\frac{1}{2}\sqrt{14}[/itex]

    So my attempt

    first find direction vector of [itex]l_1[/itex] so lets get parametric form:

    [tex]\mu = \frac{x+4}{3} = \frac{y-3}{2} = \frac{z+6}{5}[/tex]

    [tex]x = 3\mu -4[/tex]

    [tex]y = 2\mu +3[/tex]

    [tex]z = 5\mu -6[/tex]

    which gives the parametric equation

    [tex]\mathbf{r} = \left( \begin{array}{c} -4 \\ 3 \\ -6 \end{array} \right) + \mu \left( \begin{array}{c} 3 \\ 2 \\ 5 \end{array} \right)[/tex]

    so now to find the parametric equation of [itex]l_2[/itex]:

    [tex]x = t[/tex]

    using i.

    [tex] t - 2y - z = 0[/tex]

    [tex] z = t - 2y[/tex]

    using ii.

    [tex] t - 10y - 3(t - 2y) = -7 [/tex]

    [tex] t - 10y -3t + 6y = -7 [/tex]

    [tex] -2t - 4y = -7 [/tex]

    [tex] y = \frac{7}{4} - \frac{1}{2}t [/tex]

    using i.

    [tex] z = t - 2(\frac{7}{4} - \frac{1}{2}t) [/tex]

    [tex] z = t - \frac{7}{2} + t [/tex]

    [tex] z = 2t - \frac{7}{2} [/tex]

    so written in parametric vector form:

    [tex] \mathbf{r} = \left( \begin{array}{c} 0 \\ \frac{7}{4} \\ - \frac{7}{2} \end{array} \right) + t \left( \begin{array}{c} 2 \\ -1 \\ 4 \end{array} \right) [/tex]

    (obviously note the fact that I multiplied my direction vector x2 just to give integers)

    so what is required is to project an arbitary vector from and point on [itex]l_1[/itex] to [itex]l_2[/itex] in the direction of the vector orthogonal to both the lines

    so to find this vector will do the cross of the two direction vectors of the lines:

    [tex] \left| \begin{array}{ccc} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 3 & 2 & 5 \\ 2 & -1 & 4 \end{array} \right| =
    \mathbf{i} \left| \begin{array}{cc} 2 & 5 \\ -1 & 4 \\ \end{array} \right|
    - \mathbf{j} \left| \begin{array}{cc} 3 & 5 \\ 2 & 4 \\ \end{array} \right|
    + \mathbf{k} \left| \begin{array}{cc} 3 & 2 \\ 2 & -1 \\ \end{array} \right| =
    \mathbf{i} (8 + 5) - \mathbf{j} (12 -10) + \mathbf{k} (-3 -4) =
    13\mathbf{i} - 2\mathbf{j} -7\mathbf{k} = \mathbf{n}[/tex]

    Now to find a random vector [itex]\mathbf{R}[/itex] between [itex]l_1[/itex] and [itex]l_2[/itex]

    for this I will simply use their starting vectors when their respective parameters are each 0:

    [tex] \mathbf{R} = l_2(0) - l_1(0) \left( \begin{array}{c} 0 + 4 \\ \frac{7}{4} - 3 \\ - \frac{7}{2} + 6 \end{array} \right) = \left( \begin{array}{c} 4 \\ -\frac{5}{4} \\ \frac{5}{2} \end{array} \right) [/tex]

    so the final step should be to take the scalar product of R and [itex] \mathbf{\hat{n}}[/itex]:

    [tex] \mathbf{R} \cdot \mathbf{\hat{n}} = \frac{1}{\sqrt{169 + 4 + 49}} \left( \begin{array}{c} 4 \\ -\frac{5}{4} \\ \frac{5}{2} \end{array} \right) \cdot
    \left( \begin{array}{c} 13 \\ -2 \\ -7 \end{array} \right) =
    \frac{52 + \frac{5}{2} - \frac{35}{2}}{\sqrt{169 + 4 + 49}} =
    \frac{\left( \frac{104 + 5 - 35}{2} \right)}{\sqrt{222}} =
    \frac{37}{\sqrt{222}} [/tex]

    and that's it, and its not what they give that it should be, I have tried approaching it other ways but I always get the same answer, Im pretty sure I havnt made any numeral errors, and pretty sure i havnt made any conceptual errors, so I am really stumped, and help would be so appreciated guys, thanks allot :D
  2. jcsd
  3. Jun 5, 2009 #2


    User Avatar
    Homework Helper
    Gold Member

    I get the exact same thing as you using two different methods. So unless you've made a typo transcribing the original problem, it looks as though the error is with whomever created the question.
  4. Jun 5, 2009 #3


    User Avatar
    Science Advisor
    Homework Helper

    Hi Galadirith! Hi gabbagabbahey! :smile:

    Yes, I make it the same.

    What is the given answer?

    (222 = 37 x 6 … does that help?)
  5. Jun 5, 2009 #4
    Hi guys, thanks for the replies, yeh the question at the begining of my post is exaclty as the question is worded (doubley checked :D), although I did simply add the [itex]l_i[/tex]'s and the i. and ii. oviously though that was purly so I could reference them in my solution. Yeh so I am completly stumped, as posted the answer is actually in the question, so you have to show that that is correct so tiny-tim the given answer is [itex]\frac{1}{2} \sqrt{14}[/itex].

    And tiny yeh I noticed that to but if you go that root youll end with something like [itex]\sqrt{37} / \sqrt{6}[/itex] or manipulate it differently but still not really ovious in any way how there could be an error to get there answer. I suppose pehaps:

    [tex] \frac{37}{\sqrt{222}} = \frac{\sqrt{37}}{\sqrt{6}} = \sqrt{\frac{74}{12}} = \sqrt{\frac{74}{3 \times 4}} = \frac{1}{2} \sqrt{\frac{74}{3}} [/tex]

    and em 74/3 = aprox. 24, sort of 14, ha now Im just trying to see where they went wrong:D

    It has to be an error they made then, as the answer is quite precise and not of a form you would get from straight from computing the scalar product (ie you would have to manipulate your answer from a scalar product to get it in to a form where you have a surd in the numerator, in most cases at least) I would quess that they wrote the question down wrong, I can imagine that if I change 1 or 2 of the values for on of the equations defining the lines I would get their answer.

    Thanks so much guys, I can rest now knowing the brains of PF come to the same conclusion as me, thanks alot :D really appreciated
  6. Jun 6, 2009 #5


    User Avatar
    Science Advisor
    Homework Helper

    Hi Galadirith! :smile:
    ok :rolleyes: … let's work this backwards :wink:

    (√14)/2 = 7/√14,

    and the only place that √14 can come from is the magnitude of n

    Now 14 = 9 + 4 + 1, so n is probably in the direction (±3,±2,±1), not necessarily in that order

    So if we change the cross-product …
    (nice LaTeX, btw! :smile:)

    by replacing the -1 by 1, we get

    [tex] \left| \begin{array}{ccc} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 3 & 2 & 5 \\ 2 & 1 & 4 \end{array} \right| =
    \mathbf{i} \left| \begin{array}{cc} 2 & 5 \\ 1 & 4 \\ \end{array} \right|
    - \mathbf{j} \left| \begin{array}{cc} 3 & 5 \\ 2 & 4 \\ \end{array} \right|
    + \mathbf{k} \left| \begin{array}{cc} 3 & 2 \\ 2 & 1 \\ \end{array} \right| =
    \mathbf{i} (8 - 5) - \mathbf{j} (12 -10) + \mathbf{k} (3 -4) =
    3\mathbf{i} - 2\mathbf{j} -\mathbf{k} = \mathbf{n}[/tex]

    … I'll leave the rest to you! :biggrin:
  7. Jun 6, 2009 #6
    Oh tiny-tim wow that's some insane back tracking :D. Thanks for that so yeh it was a numeral error on their part, thanks tiny-tim, I don't know how you noticed that error even working backwards that was awesome :D, can I ask how did you see that?

    PS: thanks for the comment about the LaTex :D gotta love LaTex
  8. Jun 6, 2009 #7


    User Avatar
    Science Advisor
    Homework Helper

    easy, man …

    Hi Galadirith! :smile:
    easy :biggrin: … the question only has whole numbers, so the only place the √ can come from is the magnitude …

    then 14 as a sum of squares is obviously 3,2,1 :wink:

    then just compare 3,2,1 with 13,2,7 …

    there's only going to be two mistakes, so assume the 2 is ok …

    and there you are! o:)
    Now you gotta learn smilies :tongue2: …

    gotta love :!!) LaTex​

    :wink: smilies are your friends! :smile:
  9. Jun 6, 2009 #8
    Thanks tiny-tim :smile:, I dont want to take you time at all but really do want to understand how you came to that, I actually got all the first bit from you previous post to do with the [itex]\sqrt{14}[/itex] but you then lost me at
    Im not quite sure what you meant by "two mistakes" and the "2". What I am assuming is that you compared the actual vector that was correctly computed with the 3 2 1 components that you reasoned from the [itex]\sqrt{14}[/itex], you see that both contain 2, so the j component is correct so the only values that should be changed are the j components of the two direction vector of the two lines do to how one evaluates the determinant of a matrix ... oh ha, I think I have just answered my own question!

    ooooooh the 2 your referring to is the two in [itex]M_{2,2}[/itex] of the matrix and I quess you thought that the error they made would simply be a simple error i.e. a change of sign :biggrin: I see you thought process there I suppose the first part is more logic but the second is more mathematical intuition :wink:, I suppose for me I could have just tried all the possible combinations of ±2 and ±1 of the column of the matrix (only 4 so not exactly exhaustive) , lol, thanks again tiny-tim
  10. Jun 6, 2009 #9


    User Avatar
    Science Advisor
    Homework Helper

    :rofl: :rofl:
    we get a lot of that! :biggrin:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook