shortest distance between two vectors












0












$begingroup$


Whilst working on vectors I have come across a lot of problems like this. I am able to work it out for the shortest distance from a vector to a point, but not from a vector to a vector. Here is my usual method for a question asking the shortest distance from a vector (passing through $A$ and $B$) to a point $C$:
$$vec{OA}=a$$
$$vec{OB}=b$$
$$vec{OC}=c$$
Where $O$ is the origin. We know that the equation for a line passing through $A$ and $B$ is:
$$vec{r}=mu(b-a)+a$$
we also know that at the closest distance a line from $C$ to $vec{r}$ is perpendicular to $vec{r}$.
I would now define:
$$vec{r}=begin{pmatrix}mu(b_1-a_1)+a_1\mu(b_2-a_2)+a_2\mu(b_3-a_3)+a_3end{pmatrix}=begin{pmatrix}d_1\d_2\d_3end{pmatrix}$$
so the distance from $vec{r}$ to $C$ is:
$$l=sqrt{(d_1-c_1)^2+(d_2-c_2)^2+(d_3-c_3)^2}$$
now find the point at which $frac{dl}{dmu}=0$ solving for $mu$ and subbing into the equation.



However, I am aware that there are much easier methods for find the point $N$ and the shortest distance $|vec{NC}|$ involving the fact that $vec{r}bulletvec{NC}=0$ or potentially cross product as well. Does anyone have a tutorial for this method? Also, how would I solve this same problem but finding the minimum distance between two vectors?
Thanks










share|cite|improve this question









$endgroup$












  • $begingroup$
    It appears that by “distance to a vector” you really mean the distance to a line defined by a pair of points. As a hint, the situation is symmetric, so the points on each of two lines that are nearest to each other lie on a mutual perpendicular to the lines.
    $endgroup$
    – amd
    Jan 21 at 0:19










  • $begingroup$
    So if they are both perpendicular to the same line, then I can presume they are parallel
    $endgroup$
    – Henry Lee
    Jan 21 at 0:47






  • 1




    $begingroup$
    Not at all. The $x$-axis is perpendicular to both the $y$-axis and the line $(1,0,0)+t(0,0,1)$, but they are neither parallel nor do they intersect.
    $endgroup$
    – amd
    Jan 21 at 2:59
















0












$begingroup$


Whilst working on vectors I have come across a lot of problems like this. I am able to work it out for the shortest distance from a vector to a point, but not from a vector to a vector. Here is my usual method for a question asking the shortest distance from a vector (passing through $A$ and $B$) to a point $C$:
$$vec{OA}=a$$
$$vec{OB}=b$$
$$vec{OC}=c$$
Where $O$ is the origin. We know that the equation for a line passing through $A$ and $B$ is:
$$vec{r}=mu(b-a)+a$$
we also know that at the closest distance a line from $C$ to $vec{r}$ is perpendicular to $vec{r}$.
I would now define:
$$vec{r}=begin{pmatrix}mu(b_1-a_1)+a_1\mu(b_2-a_2)+a_2\mu(b_3-a_3)+a_3end{pmatrix}=begin{pmatrix}d_1\d_2\d_3end{pmatrix}$$
so the distance from $vec{r}$ to $C$ is:
$$l=sqrt{(d_1-c_1)^2+(d_2-c_2)^2+(d_3-c_3)^2}$$
now find the point at which $frac{dl}{dmu}=0$ solving for $mu$ and subbing into the equation.



However, I am aware that there are much easier methods for find the point $N$ and the shortest distance $|vec{NC}|$ involving the fact that $vec{r}bulletvec{NC}=0$ or potentially cross product as well. Does anyone have a tutorial for this method? Also, how would I solve this same problem but finding the minimum distance between two vectors?
Thanks










share|cite|improve this question









$endgroup$












  • $begingroup$
    It appears that by “distance to a vector” you really mean the distance to a line defined by a pair of points. As a hint, the situation is symmetric, so the points on each of two lines that are nearest to each other lie on a mutual perpendicular to the lines.
    $endgroup$
    – amd
    Jan 21 at 0:19










  • $begingroup$
    So if they are both perpendicular to the same line, then I can presume they are parallel
    $endgroup$
    – Henry Lee
    Jan 21 at 0:47






  • 1




    $begingroup$
    Not at all. The $x$-axis is perpendicular to both the $y$-axis and the line $(1,0,0)+t(0,0,1)$, but they are neither parallel nor do they intersect.
    $endgroup$
    – amd
    Jan 21 at 2:59














0












0








0





$begingroup$


Whilst working on vectors I have come across a lot of problems like this. I am able to work it out for the shortest distance from a vector to a point, but not from a vector to a vector. Here is my usual method for a question asking the shortest distance from a vector (passing through $A$ and $B$) to a point $C$:
$$vec{OA}=a$$
$$vec{OB}=b$$
$$vec{OC}=c$$
Where $O$ is the origin. We know that the equation for a line passing through $A$ and $B$ is:
$$vec{r}=mu(b-a)+a$$
we also know that at the closest distance a line from $C$ to $vec{r}$ is perpendicular to $vec{r}$.
I would now define:
$$vec{r}=begin{pmatrix}mu(b_1-a_1)+a_1\mu(b_2-a_2)+a_2\mu(b_3-a_3)+a_3end{pmatrix}=begin{pmatrix}d_1\d_2\d_3end{pmatrix}$$
so the distance from $vec{r}$ to $C$ is:
$$l=sqrt{(d_1-c_1)^2+(d_2-c_2)^2+(d_3-c_3)^2}$$
now find the point at which $frac{dl}{dmu}=0$ solving for $mu$ and subbing into the equation.



However, I am aware that there are much easier methods for find the point $N$ and the shortest distance $|vec{NC}|$ involving the fact that $vec{r}bulletvec{NC}=0$ or potentially cross product as well. Does anyone have a tutorial for this method? Also, how would I solve this same problem but finding the minimum distance between two vectors?
Thanks










share|cite|improve this question









$endgroup$




Whilst working on vectors I have come across a lot of problems like this. I am able to work it out for the shortest distance from a vector to a point, but not from a vector to a vector. Here is my usual method for a question asking the shortest distance from a vector (passing through $A$ and $B$) to a point $C$:
$$vec{OA}=a$$
$$vec{OB}=b$$
$$vec{OC}=c$$
Where $O$ is the origin. We know that the equation for a line passing through $A$ and $B$ is:
$$vec{r}=mu(b-a)+a$$
we also know that at the closest distance a line from $C$ to $vec{r}$ is perpendicular to $vec{r}$.
I would now define:
$$vec{r}=begin{pmatrix}mu(b_1-a_1)+a_1\mu(b_2-a_2)+a_2\mu(b_3-a_3)+a_3end{pmatrix}=begin{pmatrix}d_1\d_2\d_3end{pmatrix}$$
so the distance from $vec{r}$ to $C$ is:
$$l=sqrt{(d_1-c_1)^2+(d_2-c_2)^2+(d_3-c_3)^2}$$
now find the point at which $frac{dl}{dmu}=0$ solving for $mu$ and subbing into the equation.



However, I am aware that there are much easier methods for find the point $N$ and the shortest distance $|vec{NC}|$ involving the fact that $vec{r}bulletvec{NC}=0$ or potentially cross product as well. Does anyone have a tutorial for this method? Also, how would I solve this same problem but finding the minimum distance between two vectors?
Thanks







vectors






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jan 21 at 0:04









Henry LeeHenry Lee

2,042219




2,042219












  • $begingroup$
    It appears that by “distance to a vector” you really mean the distance to a line defined by a pair of points. As a hint, the situation is symmetric, so the points on each of two lines that are nearest to each other lie on a mutual perpendicular to the lines.
    $endgroup$
    – amd
    Jan 21 at 0:19










  • $begingroup$
    So if they are both perpendicular to the same line, then I can presume they are parallel
    $endgroup$
    – Henry Lee
    Jan 21 at 0:47






  • 1




    $begingroup$
    Not at all. The $x$-axis is perpendicular to both the $y$-axis and the line $(1,0,0)+t(0,0,1)$, but they are neither parallel nor do they intersect.
    $endgroup$
    – amd
    Jan 21 at 2:59


















  • $begingroup$
    It appears that by “distance to a vector” you really mean the distance to a line defined by a pair of points. As a hint, the situation is symmetric, so the points on each of two lines that are nearest to each other lie on a mutual perpendicular to the lines.
    $endgroup$
    – amd
    Jan 21 at 0:19










  • $begingroup$
    So if they are both perpendicular to the same line, then I can presume they are parallel
    $endgroup$
    – Henry Lee
    Jan 21 at 0:47






  • 1




    $begingroup$
    Not at all. The $x$-axis is perpendicular to both the $y$-axis and the line $(1,0,0)+t(0,0,1)$, but they are neither parallel nor do they intersect.
    $endgroup$
    – amd
    Jan 21 at 2:59
















$begingroup$
It appears that by “distance to a vector” you really mean the distance to a line defined by a pair of points. As a hint, the situation is symmetric, so the points on each of two lines that are nearest to each other lie on a mutual perpendicular to the lines.
$endgroup$
– amd
Jan 21 at 0:19




$begingroup$
It appears that by “distance to a vector” you really mean the distance to a line defined by a pair of points. As a hint, the situation is symmetric, so the points on each of two lines that are nearest to each other lie on a mutual perpendicular to the lines.
$endgroup$
– amd
Jan 21 at 0:19












$begingroup$
So if they are both perpendicular to the same line, then I can presume they are parallel
$endgroup$
– Henry Lee
Jan 21 at 0:47




$begingroup$
So if they are both perpendicular to the same line, then I can presume they are parallel
$endgroup$
– Henry Lee
Jan 21 at 0:47




1




1




$begingroup$
Not at all. The $x$-axis is perpendicular to both the $y$-axis and the line $(1,0,0)+t(0,0,1)$, but they are neither parallel nor do they intersect.
$endgroup$
– amd
Jan 21 at 2:59




$begingroup$
Not at all. The $x$-axis is perpendicular to both the $y$-axis and the line $(1,0,0)+t(0,0,1)$, but they are neither parallel nor do they intersect.
$endgroup$
– amd
Jan 21 at 2:59










2 Answers
2






active

oldest

votes


















1












$begingroup$

For problems like this one you don't need derivatives.



enter image description here



Suppose that you know the coordinates of points $A(x_A, y_A, z_A)$, $B(x_B, y_B, z_B)$ and components of vectors $vec a=(a_x,a_y,a_z)$, $vec b=(b_x,b_y,b_z)$. The shortest distance between lines is represented with segment $CD$ and that segment is prependicular both to $vec a$ and $vec b$.



Now you have:



$$AC=mu vec a$$



$$BD=lambda vec b$$



$$vec {CD} bot vec a implies vec{CD}cdot vec a=0$$



$$vec {CD} bot vec b implies vec{CD}cdot vec b=0$$



...or, in scalar form:



$$x_C-x_A=lambda a_x$$



$$y_C-y_A=lambda a_y$$



$$z_C-z_A=lambda a_z$$



$$x_D-x_B=mu b_x$$



$$y_D-y_B=mu b_y$$



$$z_D-z_B=mu b_z$$



$$(x_D-x_C)a_x+(y_D-y_C)a_y+(z_D-z_C)a_z=0$$



$$(x_D-x_C)b_x+(y_D-y_C)b_y+(z_D-z_C)b_z=0$$



You have 8 linear equations and 8 unknowns: $x_C, y_C, z_C, x_D, y_D, z_D, lambda, mu$:




  • From the first three equations express $x_C, y_C, z_C$ in terms of $lambda$.

  • From the next three equations express $x_D, y_D, z_D$ in terms of $mu$.

  • Replace all that into the last two equations and you have a system of two equations with two unknowns $(lambda,mu)$.

  • Solve, find coordinates of points $C,D$

  • Calculate distance CD.






share|cite|improve this answer











$endgroup$





















    1












    $begingroup$

    For the shortest distance between a pair of lines $L_1$ and $L_2$ in $mathbb R^3$, you can use symmetry and projections to develop a simple formula. You already know that the closest point on a line to a point $P$ not on the line lies on the perpendicular through $P$. So by symmetry, the nearest points to each other on a pair of lines must lie on a line $M$ that’s perpendicular to them both.



    Working backwards for a moment, suppose that $Q_1$ and $Q_2$ are the nearest points to each other on the two lines. Since $L_1perp M$, the orthogonal projection of any point on $L_1$ onto $M$ is $Q_1$ and similarly, the orthogonal projection of any point on $L_2$ onto $M$ is $Q_2$. Hence, given any pair of points on the two lines, the orthogonal projection onto $M$ of the segment joining them is $overline{Q_1Q_2}$. This means that the shortest distance between $L_1$ and $L_2$ can be found by taking any pair of points on the respective lines and projecting them onto any line that’s perpendicular to $L_1$ and $L_2$.



    Now, since $M$ is perpendicular to both $L_1$ and $L_2$, if you represent the two lines in parametric form as $P_1+svec v_1$ and $P_2+tvec v_2$, respectively, then the cross product $vec v = vec v_1timesvec v_2$ is a direction vector for $M$. For points on the lines, we can take $P_1$ and $P_2$, and so the distance between $L_1$ and $L_2$ is the length of the orthogonal projection of $P_1-P_2$ onto $vec v$: $${|(P_1-P_2)cdot(vec v_1timesvec v_2)| over |vec v_1timesvec v_2|}.$$





    You can also develop a simple formula for 3-D point-line distance using geometric considerations. Again, let the line be given in parametric form as $P+tvec v$ and $Q$ be an arbitrary point. Consider the triangle formed by $P$, $Q$ and $R=Q+vec v$. Taking $overline{QR}$ as the base of the triangle, its area is $frac12bh = frac12 |vec v| h$, but the altitude $h$ is the perpendicular distance from $P$ to the line. The area of this triangle is $frac12|(P-Q)timesvec v|$ (it’s half the area of the paralellogram defined by these two vectors), from which we have $$h = {|(P-Q)timesvec v|over|vec v|}.$$






    share|cite|improve this answer











    $endgroup$













      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "69"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3081301%2fshortest-distance-between-two-vectors%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1












      $begingroup$

      For problems like this one you don't need derivatives.



      enter image description here



      Suppose that you know the coordinates of points $A(x_A, y_A, z_A)$, $B(x_B, y_B, z_B)$ and components of vectors $vec a=(a_x,a_y,a_z)$, $vec b=(b_x,b_y,b_z)$. The shortest distance between lines is represented with segment $CD$ and that segment is prependicular both to $vec a$ and $vec b$.



      Now you have:



      $$AC=mu vec a$$



      $$BD=lambda vec b$$



      $$vec {CD} bot vec a implies vec{CD}cdot vec a=0$$



      $$vec {CD} bot vec b implies vec{CD}cdot vec b=0$$



      ...or, in scalar form:



      $$x_C-x_A=lambda a_x$$



      $$y_C-y_A=lambda a_y$$



      $$z_C-z_A=lambda a_z$$



      $$x_D-x_B=mu b_x$$



      $$y_D-y_B=mu b_y$$



      $$z_D-z_B=mu b_z$$



      $$(x_D-x_C)a_x+(y_D-y_C)a_y+(z_D-z_C)a_z=0$$



      $$(x_D-x_C)b_x+(y_D-y_C)b_y+(z_D-z_C)b_z=0$$



      You have 8 linear equations and 8 unknowns: $x_C, y_C, z_C, x_D, y_D, z_D, lambda, mu$:




      • From the first three equations express $x_C, y_C, z_C$ in terms of $lambda$.

      • From the next three equations express $x_D, y_D, z_D$ in terms of $mu$.

      • Replace all that into the last two equations and you have a system of two equations with two unknowns $(lambda,mu)$.

      • Solve, find coordinates of points $C,D$

      • Calculate distance CD.






      share|cite|improve this answer











      $endgroup$


















        1












        $begingroup$

        For problems like this one you don't need derivatives.



        enter image description here



        Suppose that you know the coordinates of points $A(x_A, y_A, z_A)$, $B(x_B, y_B, z_B)$ and components of vectors $vec a=(a_x,a_y,a_z)$, $vec b=(b_x,b_y,b_z)$. The shortest distance between lines is represented with segment $CD$ and that segment is prependicular both to $vec a$ and $vec b$.



        Now you have:



        $$AC=mu vec a$$



        $$BD=lambda vec b$$



        $$vec {CD} bot vec a implies vec{CD}cdot vec a=0$$



        $$vec {CD} bot vec b implies vec{CD}cdot vec b=0$$



        ...or, in scalar form:



        $$x_C-x_A=lambda a_x$$



        $$y_C-y_A=lambda a_y$$



        $$z_C-z_A=lambda a_z$$



        $$x_D-x_B=mu b_x$$



        $$y_D-y_B=mu b_y$$



        $$z_D-z_B=mu b_z$$



        $$(x_D-x_C)a_x+(y_D-y_C)a_y+(z_D-z_C)a_z=0$$



        $$(x_D-x_C)b_x+(y_D-y_C)b_y+(z_D-z_C)b_z=0$$



        You have 8 linear equations and 8 unknowns: $x_C, y_C, z_C, x_D, y_D, z_D, lambda, mu$:




        • From the first three equations express $x_C, y_C, z_C$ in terms of $lambda$.

        • From the next three equations express $x_D, y_D, z_D$ in terms of $mu$.

        • Replace all that into the last two equations and you have a system of two equations with two unknowns $(lambda,mu)$.

        • Solve, find coordinates of points $C,D$

        • Calculate distance CD.






        share|cite|improve this answer











        $endgroup$
















          1












          1








          1





          $begingroup$

          For problems like this one you don't need derivatives.



          enter image description here



          Suppose that you know the coordinates of points $A(x_A, y_A, z_A)$, $B(x_B, y_B, z_B)$ and components of vectors $vec a=(a_x,a_y,a_z)$, $vec b=(b_x,b_y,b_z)$. The shortest distance between lines is represented with segment $CD$ and that segment is prependicular both to $vec a$ and $vec b$.



          Now you have:



          $$AC=mu vec a$$



          $$BD=lambda vec b$$



          $$vec {CD} bot vec a implies vec{CD}cdot vec a=0$$



          $$vec {CD} bot vec b implies vec{CD}cdot vec b=0$$



          ...or, in scalar form:



          $$x_C-x_A=lambda a_x$$



          $$y_C-y_A=lambda a_y$$



          $$z_C-z_A=lambda a_z$$



          $$x_D-x_B=mu b_x$$



          $$y_D-y_B=mu b_y$$



          $$z_D-z_B=mu b_z$$



          $$(x_D-x_C)a_x+(y_D-y_C)a_y+(z_D-z_C)a_z=0$$



          $$(x_D-x_C)b_x+(y_D-y_C)b_y+(z_D-z_C)b_z=0$$



          You have 8 linear equations and 8 unknowns: $x_C, y_C, z_C, x_D, y_D, z_D, lambda, mu$:




          • From the first three equations express $x_C, y_C, z_C$ in terms of $lambda$.

          • From the next three equations express $x_D, y_D, z_D$ in terms of $mu$.

          • Replace all that into the last two equations and you have a system of two equations with two unknowns $(lambda,mu)$.

          • Solve, find coordinates of points $C,D$

          • Calculate distance CD.






          share|cite|improve this answer











          $endgroup$



          For problems like this one you don't need derivatives.



          enter image description here



          Suppose that you know the coordinates of points $A(x_A, y_A, z_A)$, $B(x_B, y_B, z_B)$ and components of vectors $vec a=(a_x,a_y,a_z)$, $vec b=(b_x,b_y,b_z)$. The shortest distance between lines is represented with segment $CD$ and that segment is prependicular both to $vec a$ and $vec b$.



          Now you have:



          $$AC=mu vec a$$



          $$BD=lambda vec b$$



          $$vec {CD} bot vec a implies vec{CD}cdot vec a=0$$



          $$vec {CD} bot vec b implies vec{CD}cdot vec b=0$$



          ...or, in scalar form:



          $$x_C-x_A=lambda a_x$$



          $$y_C-y_A=lambda a_y$$



          $$z_C-z_A=lambda a_z$$



          $$x_D-x_B=mu b_x$$



          $$y_D-y_B=mu b_y$$



          $$z_D-z_B=mu b_z$$



          $$(x_D-x_C)a_x+(y_D-y_C)a_y+(z_D-z_C)a_z=0$$



          $$(x_D-x_C)b_x+(y_D-y_C)b_y+(z_D-z_C)b_z=0$$



          You have 8 linear equations and 8 unknowns: $x_C, y_C, z_C, x_D, y_D, z_D, lambda, mu$:




          • From the first three equations express $x_C, y_C, z_C$ in terms of $lambda$.

          • From the next three equations express $x_D, y_D, z_D$ in terms of $mu$.

          • Replace all that into the last two equations and you have a system of two equations with two unknowns $(lambda,mu)$.

          • Solve, find coordinates of points $C,D$

          • Calculate distance CD.







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Jan 21 at 15:53

























          answered Jan 21 at 8:35









          OldboyOldboy

          8,4521936




          8,4521936























              1












              $begingroup$

              For the shortest distance between a pair of lines $L_1$ and $L_2$ in $mathbb R^3$, you can use symmetry and projections to develop a simple formula. You already know that the closest point on a line to a point $P$ not on the line lies on the perpendicular through $P$. So by symmetry, the nearest points to each other on a pair of lines must lie on a line $M$ that’s perpendicular to them both.



              Working backwards for a moment, suppose that $Q_1$ and $Q_2$ are the nearest points to each other on the two lines. Since $L_1perp M$, the orthogonal projection of any point on $L_1$ onto $M$ is $Q_1$ and similarly, the orthogonal projection of any point on $L_2$ onto $M$ is $Q_2$. Hence, given any pair of points on the two lines, the orthogonal projection onto $M$ of the segment joining them is $overline{Q_1Q_2}$. This means that the shortest distance between $L_1$ and $L_2$ can be found by taking any pair of points on the respective lines and projecting them onto any line that’s perpendicular to $L_1$ and $L_2$.



              Now, since $M$ is perpendicular to both $L_1$ and $L_2$, if you represent the two lines in parametric form as $P_1+svec v_1$ and $P_2+tvec v_2$, respectively, then the cross product $vec v = vec v_1timesvec v_2$ is a direction vector for $M$. For points on the lines, we can take $P_1$ and $P_2$, and so the distance between $L_1$ and $L_2$ is the length of the orthogonal projection of $P_1-P_2$ onto $vec v$: $${|(P_1-P_2)cdot(vec v_1timesvec v_2)| over |vec v_1timesvec v_2|}.$$





              You can also develop a simple formula for 3-D point-line distance using geometric considerations. Again, let the line be given in parametric form as $P+tvec v$ and $Q$ be an arbitrary point. Consider the triangle formed by $P$, $Q$ and $R=Q+vec v$. Taking $overline{QR}$ as the base of the triangle, its area is $frac12bh = frac12 |vec v| h$, but the altitude $h$ is the perpendicular distance from $P$ to the line. The area of this triangle is $frac12|(P-Q)timesvec v|$ (it’s half the area of the paralellogram defined by these two vectors), from which we have $$h = {|(P-Q)timesvec v|over|vec v|}.$$






              share|cite|improve this answer











              $endgroup$


















                1












                $begingroup$

                For the shortest distance between a pair of lines $L_1$ and $L_2$ in $mathbb R^3$, you can use symmetry and projections to develop a simple formula. You already know that the closest point on a line to a point $P$ not on the line lies on the perpendicular through $P$. So by symmetry, the nearest points to each other on a pair of lines must lie on a line $M$ that’s perpendicular to them both.



                Working backwards for a moment, suppose that $Q_1$ and $Q_2$ are the nearest points to each other on the two lines. Since $L_1perp M$, the orthogonal projection of any point on $L_1$ onto $M$ is $Q_1$ and similarly, the orthogonal projection of any point on $L_2$ onto $M$ is $Q_2$. Hence, given any pair of points on the two lines, the orthogonal projection onto $M$ of the segment joining them is $overline{Q_1Q_2}$. This means that the shortest distance between $L_1$ and $L_2$ can be found by taking any pair of points on the respective lines and projecting them onto any line that’s perpendicular to $L_1$ and $L_2$.



                Now, since $M$ is perpendicular to both $L_1$ and $L_2$, if you represent the two lines in parametric form as $P_1+svec v_1$ and $P_2+tvec v_2$, respectively, then the cross product $vec v = vec v_1timesvec v_2$ is a direction vector for $M$. For points on the lines, we can take $P_1$ and $P_2$, and so the distance between $L_1$ and $L_2$ is the length of the orthogonal projection of $P_1-P_2$ onto $vec v$: $${|(P_1-P_2)cdot(vec v_1timesvec v_2)| over |vec v_1timesvec v_2|}.$$





                You can also develop a simple formula for 3-D point-line distance using geometric considerations. Again, let the line be given in parametric form as $P+tvec v$ and $Q$ be an arbitrary point. Consider the triangle formed by $P$, $Q$ and $R=Q+vec v$. Taking $overline{QR}$ as the base of the triangle, its area is $frac12bh = frac12 |vec v| h$, but the altitude $h$ is the perpendicular distance from $P$ to the line. The area of this triangle is $frac12|(P-Q)timesvec v|$ (it’s half the area of the paralellogram defined by these two vectors), from which we have $$h = {|(P-Q)timesvec v|over|vec v|}.$$






                share|cite|improve this answer











                $endgroup$
















                  1












                  1








                  1





                  $begingroup$

                  For the shortest distance between a pair of lines $L_1$ and $L_2$ in $mathbb R^3$, you can use symmetry and projections to develop a simple formula. You already know that the closest point on a line to a point $P$ not on the line lies on the perpendicular through $P$. So by symmetry, the nearest points to each other on a pair of lines must lie on a line $M$ that’s perpendicular to them both.



                  Working backwards for a moment, suppose that $Q_1$ and $Q_2$ are the nearest points to each other on the two lines. Since $L_1perp M$, the orthogonal projection of any point on $L_1$ onto $M$ is $Q_1$ and similarly, the orthogonal projection of any point on $L_2$ onto $M$ is $Q_2$. Hence, given any pair of points on the two lines, the orthogonal projection onto $M$ of the segment joining them is $overline{Q_1Q_2}$. This means that the shortest distance between $L_1$ and $L_2$ can be found by taking any pair of points on the respective lines and projecting them onto any line that’s perpendicular to $L_1$ and $L_2$.



                  Now, since $M$ is perpendicular to both $L_1$ and $L_2$, if you represent the two lines in parametric form as $P_1+svec v_1$ and $P_2+tvec v_2$, respectively, then the cross product $vec v = vec v_1timesvec v_2$ is a direction vector for $M$. For points on the lines, we can take $P_1$ and $P_2$, and so the distance between $L_1$ and $L_2$ is the length of the orthogonal projection of $P_1-P_2$ onto $vec v$: $${|(P_1-P_2)cdot(vec v_1timesvec v_2)| over |vec v_1timesvec v_2|}.$$





                  You can also develop a simple formula for 3-D point-line distance using geometric considerations. Again, let the line be given in parametric form as $P+tvec v$ and $Q$ be an arbitrary point. Consider the triangle formed by $P$, $Q$ and $R=Q+vec v$. Taking $overline{QR}$ as the base of the triangle, its area is $frac12bh = frac12 |vec v| h$, but the altitude $h$ is the perpendicular distance from $P$ to the line. The area of this triangle is $frac12|(P-Q)timesvec v|$ (it’s half the area of the paralellogram defined by these two vectors), from which we have $$h = {|(P-Q)timesvec v|over|vec v|}.$$






                  share|cite|improve this answer











                  $endgroup$



                  For the shortest distance between a pair of lines $L_1$ and $L_2$ in $mathbb R^3$, you can use symmetry and projections to develop a simple formula. You already know that the closest point on a line to a point $P$ not on the line lies on the perpendicular through $P$. So by symmetry, the nearest points to each other on a pair of lines must lie on a line $M$ that’s perpendicular to them both.



                  Working backwards for a moment, suppose that $Q_1$ and $Q_2$ are the nearest points to each other on the two lines. Since $L_1perp M$, the orthogonal projection of any point on $L_1$ onto $M$ is $Q_1$ and similarly, the orthogonal projection of any point on $L_2$ onto $M$ is $Q_2$. Hence, given any pair of points on the two lines, the orthogonal projection onto $M$ of the segment joining them is $overline{Q_1Q_2}$. This means that the shortest distance between $L_1$ and $L_2$ can be found by taking any pair of points on the respective lines and projecting them onto any line that’s perpendicular to $L_1$ and $L_2$.



                  Now, since $M$ is perpendicular to both $L_1$ and $L_2$, if you represent the two lines in parametric form as $P_1+svec v_1$ and $P_2+tvec v_2$, respectively, then the cross product $vec v = vec v_1timesvec v_2$ is a direction vector for $M$. For points on the lines, we can take $P_1$ and $P_2$, and so the distance between $L_1$ and $L_2$ is the length of the orthogonal projection of $P_1-P_2$ onto $vec v$: $${|(P_1-P_2)cdot(vec v_1timesvec v_2)| over |vec v_1timesvec v_2|}.$$





                  You can also develop a simple formula for 3-D point-line distance using geometric considerations. Again, let the line be given in parametric form as $P+tvec v$ and $Q$ be an arbitrary point. Consider the triangle formed by $P$, $Q$ and $R=Q+vec v$. Taking $overline{QR}$ as the base of the triangle, its area is $frac12bh = frac12 |vec v| h$, but the altitude $h$ is the perpendicular distance from $P$ to the line. The area of this triangle is $frac12|(P-Q)timesvec v|$ (it’s half the area of the paralellogram defined by these two vectors), from which we have $$h = {|(P-Q)timesvec v|over|vec v|}.$$







                  share|cite|improve this answer














                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited Jan 23 at 1:44

























                  answered Jan 22 at 20:33









                  amdamd

                  30.5k21050




                  30.5k21050






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematics Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3081301%2fshortest-distance-between-two-vectors%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Mario Kart Wii

                      What does “Dominus providebit” mean?

                      Antonio Litta Visconti Arese