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: Min. distance from a line to a line

  1. Aug 23, 2014 #1
    1. The problem statement, all variables and given/known data
    A line is inclined at equal angles to the x-, y-, z- axes and passes through the origin. Another line passes through the points (1,2,4) and (0,0,1). Find the minimum distance between the two lines.

    2. Relevant equations

    3. The attempt at a solution




    The answer says that the r2=k+λ(i+2j+3k) and the final answer is 1/[itex]\sqrt{6}[/itex].

    Could you care to explain why r2=k+λ(i+2j+3k) and when finding n, the answer excludes the lone k in r2=k+λ(i+2j+3k)? Also, when doing these kind of problems, does it matter if d=|(r1-r2).n(hat)| and not d=|(r2-r1).n(hat)|? I'm having difficulties trying to figure out which vector to subtract first.

    Thank you
  2. jcsd
  3. Aug 23, 2014 #2


    User Avatar
    Homework Helper

    r1 and r2 are the directional vectors of the lines in the formula for the distance.

  4. Aug 23, 2014 #3


    User Avatar
    Homework Helper

    Straight lines are parametrized by
    [tex]\mathbf{r}(t) = \mathbf{c} + \mathbf{m}t.[/tex] The direction of the line is determined by the gradient [itex]\mathbf{m}[/itex].

    Here the second line is parametrized by [tex]
    \mathbf{r}_2(t) = (\mathbf{i} + 2\mathbf{j} + 4\mathbf{k})t + \mathbf{k}(1 - t)
    = \mathbf{k} + (\mathbf{i} + 2\mathbf{j} + 3 \mathbf{k})t[/tex] so its gradient is [itex]\mathbf{i} + 2\mathbf{j} + 3 \mathbf{k}[/itex]

    The minimum distance occurs between two points lying on a line which perpendicular to both [itex]\mathbf{r}_1[/itex] and [itex]\mathbf{r}_2[/itex]. Thus the gradient [itex]\mathbf{n}[/itex] of this line is the cross product of the gradients of the first two, ie [tex]\mathbf{n} = (\mathbf{i} + \mathbf{j} + \mathbf{k}) \times (\mathbf{i} + 2\mathbf{j} + 3\mathbf{k}).[/tex]

    Your geometric intuition should tell you that the distance from point A to point B is the same as the distance from point B to point A. Thus if you get different results for [itex]d[/itex] by subtracting [itex]\mathbf{r}_1[/itex] from [itex]\mathbf{r}_2[/itex] and vice-versa then either you are doing something wrong or the formula is nonsensical.

    In this case if you are getting different results then you are doing something wrong: since [itex](\mathbf{r}_2 -\mathbf{r}_1)\cdot \mathbf{n} = -(\mathbf{r}_1 - \mathbf{r}_2) \cdot \mathbf{n}[/itex] it follows that [itex]|(\mathbf{r}_2 -\mathbf{r}_1)\cdot \mathbf{n}| = |(\mathbf{r}_1 - \mathbf{r}_2) \cdot \mathbf{n}|[/itex]. If that was not clear then you need to revise the basic properties of the scalar product.
  5. Aug 23, 2014 #4

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    That's not right. r1 is the displacement vector from the origin to some arbitrary point on line #1, and r2 is the displacement vector from the origin to some arbitrary point on line #2.

    What spacetimedude got wrong was his nhat. That's what uses those directional vectors.

    It doesn't matter which point you pick. As I wrote above, r2 represents some arbitrary point on line #2. You can pick any point on the line you want and you'll get the same result. The same answer, 1/√6, results whether you use (0,0,1), (1,2,4), or (10,20,31). The obvious choice here is the point (0,0,1).

    That expression r2=k+λ(i+2j+3k) represents the set of all points that lie on the second line.

    Suppose you know that [itex]\vec p_1[/itex] and [itex]\vec p_2[/itex] are displacement vectors from the origin to two distinct points on some line. Then [itex]\vec p_1 + \alpha (\vec p_2 - \vec p_1)[/itex] where [itex]\alpha[/itex] is some real number will also describe a point on that line.

    Here you know that (0,0,1) and (1,2,4) are two points on the second line. The displacement vectors that represent these points are [itex]\vec p_1 = \hat k[/itex] and [itex]\vec p_2 = \hat \imath + 2 \hat \jmath + 4\hat k[/itex]. Using [itex]\lambda[/itex] in lieu of my [itex]\alpha[/itex] (it's just a dummy variable) yields [itex]\vec r_2 = \vec p_1 + \lambda (\vec p_2 - \vec p_1) = \hat k + \lambda(\hat \imath + 2 \hat \jmath + 3\hat k)[/itex].

    Order doesn't matter. You're taking the absolute value of that inner product. Switch which one you call line #1 and line #2 and you'll get the same result.
  6. Aug 23, 2014 #5


    User Avatar
    Homework Helper

    I think DH has explained it well. The OP's problem was in calculating n. He should have been taking a cross product of the gradient of the two lines, not the cross product of two specific points that lie on those lines. (and to do this, he needs to work out the gradient of the second line).
  7. Aug 23, 2014 #6
    I've got it! Thanks so much everyone!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted