Understanding the distance between a line and a point in 3D space

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I know that there are quicker ways to do what I am about to present. But I want to understand why my approach does not work.



Let the point $P = (-6, 3, 3)$ and the line $L=(-2t,-6t,t)$.



I am trying to find the shortest distance between the point and the line. From my observation, I believe the line passes through the origin because it can be written as $$L=beginbmatrix0 \ 0 \ 0 endbmatrix +t beginbmatrix-2 \ -6 \ 1 endbmatrix $$.



Let $Q$ denoted $(a, b, c)$ be a point on $L$ such that $vecQP$ is the shortest distance between $L$ and $P$. Note that $vecQP$ is normal to $L$.



Therefore, I need to find $vecQP$ which is $vecP-vecQ$.



$vecQP = (-6 - a, 3 - b, 3 -c)$



We know that $vecQP$ and $L$ are perpendicular so the dot product is 0.



$$-2(-6 - a) - 6(3 - b) + (3 - c) = 0$$



Simplifying gives us
$$2a + 6b - c -3 = 0$$



let $a=0$, $b=1$, then by solving we know that $c=3$.



From my understanding, we should have found $Q$ which intersects $L$ and $vecQP$. Unfortunately, it seems $||vecQP||$ is not the correct answer. I think that the way I managed to pull out the $a$, $b$ and $c$ is the culprit, however I just don't understand what I did wrong.










share|cite|improve this question

























    up vote
    1
    down vote

    favorite












    I know that there are quicker ways to do what I am about to present. But I want to understand why my approach does not work.



    Let the point $P = (-6, 3, 3)$ and the line $L=(-2t,-6t,t)$.



    I am trying to find the shortest distance between the point and the line. From my observation, I believe the line passes through the origin because it can be written as $$L=beginbmatrix0 \ 0 \ 0 endbmatrix +t beginbmatrix-2 \ -6 \ 1 endbmatrix $$.



    Let $Q$ denoted $(a, b, c)$ be a point on $L$ such that $vecQP$ is the shortest distance between $L$ and $P$. Note that $vecQP$ is normal to $L$.



    Therefore, I need to find $vecQP$ which is $vecP-vecQ$.



    $vecQP = (-6 - a, 3 - b, 3 -c)$



    We know that $vecQP$ and $L$ are perpendicular so the dot product is 0.



    $$-2(-6 - a) - 6(3 - b) + (3 - c) = 0$$



    Simplifying gives us
    $$2a + 6b - c -3 = 0$$



    let $a=0$, $b=1$, then by solving we know that $c=3$.



    From my understanding, we should have found $Q$ which intersects $L$ and $vecQP$. Unfortunately, it seems $||vecQP||$ is not the correct answer. I think that the way I managed to pull out the $a$, $b$ and $c$ is the culprit, however I just don't understand what I did wrong.










    share|cite|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I know that there are quicker ways to do what I am about to present. But I want to understand why my approach does not work.



      Let the point $P = (-6, 3, 3)$ and the line $L=(-2t,-6t,t)$.



      I am trying to find the shortest distance between the point and the line. From my observation, I believe the line passes through the origin because it can be written as $$L=beginbmatrix0 \ 0 \ 0 endbmatrix +t beginbmatrix-2 \ -6 \ 1 endbmatrix $$.



      Let $Q$ denoted $(a, b, c)$ be a point on $L$ such that $vecQP$ is the shortest distance between $L$ and $P$. Note that $vecQP$ is normal to $L$.



      Therefore, I need to find $vecQP$ which is $vecP-vecQ$.



      $vecQP = (-6 - a, 3 - b, 3 -c)$



      We know that $vecQP$ and $L$ are perpendicular so the dot product is 0.



      $$-2(-6 - a) - 6(3 - b) + (3 - c) = 0$$



      Simplifying gives us
      $$2a + 6b - c -3 = 0$$



      let $a=0$, $b=1$, then by solving we know that $c=3$.



      From my understanding, we should have found $Q$ which intersects $L$ and $vecQP$. Unfortunately, it seems $||vecQP||$ is not the correct answer. I think that the way I managed to pull out the $a$, $b$ and $c$ is the culprit, however I just don't understand what I did wrong.










      share|cite|improve this question













      I know that there are quicker ways to do what I am about to present. But I want to understand why my approach does not work.



      Let the point $P = (-6, 3, 3)$ and the line $L=(-2t,-6t,t)$.



      I am trying to find the shortest distance between the point and the line. From my observation, I believe the line passes through the origin because it can be written as $$L=beginbmatrix0 \ 0 \ 0 endbmatrix +t beginbmatrix-2 \ -6 \ 1 endbmatrix $$.



      Let $Q$ denoted $(a, b, c)$ be a point on $L$ such that $vecQP$ is the shortest distance between $L$ and $P$. Note that $vecQP$ is normal to $L$.



      Therefore, I need to find $vecQP$ which is $vecP-vecQ$.



      $vecQP = (-6 - a, 3 - b, 3 -c)$



      We know that $vecQP$ and $L$ are perpendicular so the dot product is 0.



      $$-2(-6 - a) - 6(3 - b) + (3 - c) = 0$$



      Simplifying gives us
      $$2a + 6b - c -3 = 0$$



      let $a=0$, $b=1$, then by solving we know that $c=3$.



      From my understanding, we should have found $Q$ which intersects $L$ and $vecQP$. Unfortunately, it seems $||vecQP||$ is not the correct answer. I think that the way I managed to pull out the $a$, $b$ and $c$ is the culprit, however I just don't understand what I did wrong.







      linear-algebra






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked 2 hours ago









      Cedric Martens

      330211




      330211




















          4 Answers
          4






          active

          oldest

          votes

















          up vote
          2
          down vote













          You have ignored completely the constraint $Q$ being a point on $L$. That imposes $b=3a$, for example, which your proposed $a=0,b=1$ does not satisfy.






          share|cite|improve this answer



























            up vote
            1
            down vote













            You need to find the point $Q$ on $L$ minimizing the distance from $P$. Since $Q=(a,b,c)$ lies in $L$, $a,b,c$ must satisfy the relations $a=-2c$ and $b=-6c$. Further, $QP$ must be orthogonal to $L$, so $(a+6,b-3,c-3) cdot (-2,-6,1)=0$.






            share|cite|improve this answer





























              up vote
              1
              down vote













              You want to minimize$$ D^2 = (2t-6)^2+(3+6t)^2+(3-t)^2$$



              Differentiate to get $$4(2t-6)+12(3+6t)-2(3-t)=0$$
              Solve for $t$ to get $t= frac -341$
              That gives you the point on line to be $$Q=(frac 641,frac 1841, frac -341)$$






              share|cite|improve this answer



























                up vote
                1
                down vote













                Let $v = (-6,3,3), u = (-2,-6,1)$



                $v - frac ucdot vu u$



                Describes a vector from a the line defined by $(0,0,0) + ut$ to the point $v$ that is orthogonal to $u.$



                $|v - frac ucdot vu u|$ will be your distance.



                $big(v - frac ucdot vu ubig)cdotbig(v - frac ucdot vu ubig) = |v|^2 - frac (ucdot v)^2u$



                Alternatively.



                $d^2 = (-6+2t)^2 + (3+6t^2) + (3-t)^2\
                d^2 = 54 +6t +41t^2\
                d^2 = 41(t + frac 341)^2 - frac 941 + 54$



                Distance is minimized when $t = -frac 341$



                and
                $d^2 = 54 - frac 941\
                d = sqrt 54 - frac 941$



                It is worth noting that



                $54 = (-6,3,3)cdot(-6,3,3) = |v|^2\ -3 = (-6,3,3)cdot(-2,-6,1) = ucdot v\$



                and $41 = (-2,-6,1)cdot(-2,-6,1) = |u|^2$






                share|cite|improve this answer






















                  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',
                  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%2f2979814%2funderstanding-the-distance-between-a-line-and-a-point-in-3d-space%23new-answer', 'question_page');

                  );

                  Post as a guest






























                  4 Answers
                  4






                  active

                  oldest

                  votes








                  4 Answers
                  4






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes








                  up vote
                  2
                  down vote













                  You have ignored completely the constraint $Q$ being a point on $L$. That imposes $b=3a$, for example, which your proposed $a=0,b=1$ does not satisfy.






                  share|cite|improve this answer
























                    up vote
                    2
                    down vote













                    You have ignored completely the constraint $Q$ being a point on $L$. That imposes $b=3a$, for example, which your proposed $a=0,b=1$ does not satisfy.






                    share|cite|improve this answer






















                      up vote
                      2
                      down vote










                      up vote
                      2
                      down vote









                      You have ignored completely the constraint $Q$ being a point on $L$. That imposes $b=3a$, for example, which your proposed $a=0,b=1$ does not satisfy.






                      share|cite|improve this answer












                      You have ignored completely the constraint $Q$ being a point on $L$. That imposes $b=3a$, for example, which your proposed $a=0,b=1$ does not satisfy.







                      share|cite|improve this answer












                      share|cite|improve this answer



                      share|cite|improve this answer










                      answered 2 hours ago









                      user10354138

                      4,168220




                      4,168220




















                          up vote
                          1
                          down vote













                          You need to find the point $Q$ on $L$ minimizing the distance from $P$. Since $Q=(a,b,c)$ lies in $L$, $a,b,c$ must satisfy the relations $a=-2c$ and $b=-6c$. Further, $QP$ must be orthogonal to $L$, so $(a+6,b-3,c-3) cdot (-2,-6,1)=0$.






                          share|cite|improve this answer


























                            up vote
                            1
                            down vote













                            You need to find the point $Q$ on $L$ minimizing the distance from $P$. Since $Q=(a,b,c)$ lies in $L$, $a,b,c$ must satisfy the relations $a=-2c$ and $b=-6c$. Further, $QP$ must be orthogonal to $L$, so $(a+6,b-3,c-3) cdot (-2,-6,1)=0$.






                            share|cite|improve this answer
























                              up vote
                              1
                              down vote










                              up vote
                              1
                              down vote









                              You need to find the point $Q$ on $L$ minimizing the distance from $P$. Since $Q=(a,b,c)$ lies in $L$, $a,b,c$ must satisfy the relations $a=-2c$ and $b=-6c$. Further, $QP$ must be orthogonal to $L$, so $(a+6,b-3,c-3) cdot (-2,-6,1)=0$.






                              share|cite|improve this answer














                              You need to find the point $Q$ on $L$ minimizing the distance from $P$. Since $Q=(a,b,c)$ lies in $L$, $a,b,c$ must satisfy the relations $a=-2c$ and $b=-6c$. Further, $QP$ must be orthogonal to $L$, so $(a+6,b-3,c-3) cdot (-2,-6,1)=0$.







                              share|cite|improve this answer














                              share|cite|improve this answer



                              share|cite|improve this answer








                              edited 1 hour ago

























                              answered 2 hours ago









                              Gibbs

                              4,3572625




                              4,3572625




















                                  up vote
                                  1
                                  down vote













                                  You want to minimize$$ D^2 = (2t-6)^2+(3+6t)^2+(3-t)^2$$



                                  Differentiate to get $$4(2t-6)+12(3+6t)-2(3-t)=0$$
                                  Solve for $t$ to get $t= frac -341$
                                  That gives you the point on line to be $$Q=(frac 641,frac 1841, frac -341)$$






                                  share|cite|improve this answer
























                                    up vote
                                    1
                                    down vote













                                    You want to minimize$$ D^2 = (2t-6)^2+(3+6t)^2+(3-t)^2$$



                                    Differentiate to get $$4(2t-6)+12(3+6t)-2(3-t)=0$$
                                    Solve for $t$ to get $t= frac -341$
                                    That gives you the point on line to be $$Q=(frac 641,frac 1841, frac -341)$$






                                    share|cite|improve this answer






















                                      up vote
                                      1
                                      down vote










                                      up vote
                                      1
                                      down vote









                                      You want to minimize$$ D^2 = (2t-6)^2+(3+6t)^2+(3-t)^2$$



                                      Differentiate to get $$4(2t-6)+12(3+6t)-2(3-t)=0$$
                                      Solve for $t$ to get $t= frac -341$
                                      That gives you the point on line to be $$Q=(frac 641,frac 1841, frac -341)$$






                                      share|cite|improve this answer












                                      You want to minimize$$ D^2 = (2t-6)^2+(3+6t)^2+(3-t)^2$$



                                      Differentiate to get $$4(2t-6)+12(3+6t)-2(3-t)=0$$
                                      Solve for $t$ to get $t= frac -341$
                                      That gives you the point on line to be $$Q=(frac 641,frac 1841, frac -341)$$







                                      share|cite|improve this answer












                                      share|cite|improve this answer



                                      share|cite|improve this answer










                                      answered 1 hour ago









                                      Mohammad Riazi-Kermani

                                      37.3k41957




                                      37.3k41957




















                                          up vote
                                          1
                                          down vote













                                          Let $v = (-6,3,3), u = (-2,-6,1)$



                                          $v - frac ucdot vu u$



                                          Describes a vector from a the line defined by $(0,0,0) + ut$ to the point $v$ that is orthogonal to $u.$



                                          $|v - frac ucdot vu u|$ will be your distance.



                                          $big(v - frac ucdot vu ubig)cdotbig(v - frac ucdot vu ubig) = |v|^2 - frac (ucdot v)^2u$



                                          Alternatively.



                                          $d^2 = (-6+2t)^2 + (3+6t^2) + (3-t)^2\
                                          d^2 = 54 +6t +41t^2\
                                          d^2 = 41(t + frac 341)^2 - frac 941 + 54$



                                          Distance is minimized when $t = -frac 341$



                                          and
                                          $d^2 = 54 - frac 941\
                                          d = sqrt 54 - frac 941$



                                          It is worth noting that



                                          $54 = (-6,3,3)cdot(-6,3,3) = |v|^2\ -3 = (-6,3,3)cdot(-2,-6,1) = ucdot v\$



                                          and $41 = (-2,-6,1)cdot(-2,-6,1) = |u|^2$






                                          share|cite|improve this answer


























                                            up vote
                                            1
                                            down vote













                                            Let $v = (-6,3,3), u = (-2,-6,1)$



                                            $v - frac ucdot vu u$



                                            Describes a vector from a the line defined by $(0,0,0) + ut$ to the point $v$ that is orthogonal to $u.$



                                            $|v - frac ucdot vu u|$ will be your distance.



                                            $big(v - frac ucdot vu ubig)cdotbig(v - frac ucdot vu ubig) = |v|^2 - frac (ucdot v)^2u$



                                            Alternatively.



                                            $d^2 = (-6+2t)^2 + (3+6t^2) + (3-t)^2\
                                            d^2 = 54 +6t +41t^2\
                                            d^2 = 41(t + frac 341)^2 - frac 941 + 54$



                                            Distance is minimized when $t = -frac 341$



                                            and
                                            $d^2 = 54 - frac 941\
                                            d = sqrt 54 - frac 941$



                                            It is worth noting that



                                            $54 = (-6,3,3)cdot(-6,3,3) = |v|^2\ -3 = (-6,3,3)cdot(-2,-6,1) = ucdot v\$



                                            and $41 = (-2,-6,1)cdot(-2,-6,1) = |u|^2$






                                            share|cite|improve this answer
























                                              up vote
                                              1
                                              down vote










                                              up vote
                                              1
                                              down vote









                                              Let $v = (-6,3,3), u = (-2,-6,1)$



                                              $v - frac ucdot vu u$



                                              Describes a vector from a the line defined by $(0,0,0) + ut$ to the point $v$ that is orthogonal to $u.$



                                              $|v - frac ucdot vu u|$ will be your distance.



                                              $big(v - frac ucdot vu ubig)cdotbig(v - frac ucdot vu ubig) = |v|^2 - frac (ucdot v)^2u$



                                              Alternatively.



                                              $d^2 = (-6+2t)^2 + (3+6t^2) + (3-t)^2\
                                              d^2 = 54 +6t +41t^2\
                                              d^2 = 41(t + frac 341)^2 - frac 941 + 54$



                                              Distance is minimized when $t = -frac 341$



                                              and
                                              $d^2 = 54 - frac 941\
                                              d = sqrt 54 - frac 941$



                                              It is worth noting that



                                              $54 = (-6,3,3)cdot(-6,3,3) = |v|^2\ -3 = (-6,3,3)cdot(-2,-6,1) = ucdot v\$



                                              and $41 = (-2,-6,1)cdot(-2,-6,1) = |u|^2$






                                              share|cite|improve this answer














                                              Let $v = (-6,3,3), u = (-2,-6,1)$



                                              $v - frac ucdot vu u$



                                              Describes a vector from a the line defined by $(0,0,0) + ut$ to the point $v$ that is orthogonal to $u.$



                                              $|v - frac ucdot vu u|$ will be your distance.



                                              $big(v - frac ucdot vu ubig)cdotbig(v - frac ucdot vu ubig) = |v|^2 - frac (ucdot v)^2u$



                                              Alternatively.



                                              $d^2 = (-6+2t)^2 + (3+6t^2) + (3-t)^2\
                                              d^2 = 54 +6t +41t^2\
                                              d^2 = 41(t + frac 341)^2 - frac 941 + 54$



                                              Distance is minimized when $t = -frac 341$



                                              and
                                              $d^2 = 54 - frac 941\
                                              d = sqrt 54 - frac 941$



                                              It is worth noting that



                                              $54 = (-6,3,3)cdot(-6,3,3) = |v|^2\ -3 = (-6,3,3)cdot(-2,-6,1) = ucdot v\$



                                              and $41 = (-2,-6,1)cdot(-2,-6,1) = |u|^2$







                                              share|cite|improve this answer














                                              share|cite|improve this answer



                                              share|cite|improve this answer








                                              edited 1 hour ago

























                                              answered 1 hour ago









                                              Doug M

                                              41.7k31751




                                              41.7k31751



























                                                   

                                                  draft saved


                                                  draft discarded















































                                                   


                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function ()
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2979814%2funderstanding-the-distance-between-a-line-and-a-point-in-3d-space%23new-answer', 'question_page');

                                                  );

                                                  Post as a guest













































































                                                  Popular posts from this blog

                                                  How to check contact read email or not when send email to Individual?

                                                  Displaying single band from multi-band raster using QGIS

                                                  How many registers does an x86_64 CPU actually have?