Distance an arbitrary point is found along a given vector












1














Say I have a vector in 2D space defined by two points $(x_1, y_1)$ and $(x_2, y_2)$: $$vec{v}=(x_2 - x_1, y_2 - y_1)$$ I would like to find how far along that vector an arbitrary point $(x_3, y_3)$ is. This very woolly language$^*$, so I've attempted to create a diagram showing the sitation.



enter image description here



In this diagram, the quantity I'm interested in $a$, which I can calculate using Pythagoras' theorem if I know $b$ and $c$. I know $c$, which is the length of vector $(x_3 - x_1,y_3 - y_1)$, given by, $$c = sqrt{(x_3 - x_1)^2 + (y_3 - y_1)^2}$$ So, now I need to calculate $b$: the length of a vector – that I'll call $vec{u}$ – that is perpendicular to $vec{v}$ and passes through point $(x_3, y_3)$. For $vec{u}$ and $vec{v}$ to be perpendicular the dot product must be zero. That is,



$$vec{v}cdot vec{u}=0$$



$$(x_4-x_3)(x_2-x_1)+(y_4-y_3)(y_2-y_1)=0$$



This is where I begin to falter: one equation with two unknowns, $y_4$ & $x_4$. I expect there is some obvious constraint on $vec{u}$ that I should be using to eliminate an unknown, but my sleep-deprived mind is offering no help. Can someone point out what I've missed?



$$$$





$^*$I really want to use the word project to describe how my arbitrary point $(x_3, y_3)$ is placed along that vector. Is this the correct terminology?










share|cite|improve this question





























    1














    Say I have a vector in 2D space defined by two points $(x_1, y_1)$ and $(x_2, y_2)$: $$vec{v}=(x_2 - x_1, y_2 - y_1)$$ I would like to find how far along that vector an arbitrary point $(x_3, y_3)$ is. This very woolly language$^*$, so I've attempted to create a diagram showing the sitation.



    enter image description here



    In this diagram, the quantity I'm interested in $a$, which I can calculate using Pythagoras' theorem if I know $b$ and $c$. I know $c$, which is the length of vector $(x_3 - x_1,y_3 - y_1)$, given by, $$c = sqrt{(x_3 - x_1)^2 + (y_3 - y_1)^2}$$ So, now I need to calculate $b$: the length of a vector – that I'll call $vec{u}$ – that is perpendicular to $vec{v}$ and passes through point $(x_3, y_3)$. For $vec{u}$ and $vec{v}$ to be perpendicular the dot product must be zero. That is,



    $$vec{v}cdot vec{u}=0$$



    $$(x_4-x_3)(x_2-x_1)+(y_4-y_3)(y_2-y_1)=0$$



    This is where I begin to falter: one equation with two unknowns, $y_4$ & $x_4$. I expect there is some obvious constraint on $vec{u}$ that I should be using to eliminate an unknown, but my sleep-deprived mind is offering no help. Can someone point out what I've missed?



    $$$$





    $^*$I really want to use the word project to describe how my arbitrary point $(x_3, y_3)$ is placed along that vector. Is this the correct terminology?










    share|cite|improve this question



























      1












      1








      1







      Say I have a vector in 2D space defined by two points $(x_1, y_1)$ and $(x_2, y_2)$: $$vec{v}=(x_2 - x_1, y_2 - y_1)$$ I would like to find how far along that vector an arbitrary point $(x_3, y_3)$ is. This very woolly language$^*$, so I've attempted to create a diagram showing the sitation.



      enter image description here



      In this diagram, the quantity I'm interested in $a$, which I can calculate using Pythagoras' theorem if I know $b$ and $c$. I know $c$, which is the length of vector $(x_3 - x_1,y_3 - y_1)$, given by, $$c = sqrt{(x_3 - x_1)^2 + (y_3 - y_1)^2}$$ So, now I need to calculate $b$: the length of a vector – that I'll call $vec{u}$ – that is perpendicular to $vec{v}$ and passes through point $(x_3, y_3)$. For $vec{u}$ and $vec{v}$ to be perpendicular the dot product must be zero. That is,



      $$vec{v}cdot vec{u}=0$$



      $$(x_4-x_3)(x_2-x_1)+(y_4-y_3)(y_2-y_1)=0$$



      This is where I begin to falter: one equation with two unknowns, $y_4$ & $x_4$. I expect there is some obvious constraint on $vec{u}$ that I should be using to eliminate an unknown, but my sleep-deprived mind is offering no help. Can someone point out what I've missed?



      $$$$





      $^*$I really want to use the word project to describe how my arbitrary point $(x_3, y_3)$ is placed along that vector. Is this the correct terminology?










      share|cite|improve this question















      Say I have a vector in 2D space defined by two points $(x_1, y_1)$ and $(x_2, y_2)$: $$vec{v}=(x_2 - x_1, y_2 - y_1)$$ I would like to find how far along that vector an arbitrary point $(x_3, y_3)$ is. This very woolly language$^*$, so I've attempted to create a diagram showing the sitation.



      enter image description here



      In this diagram, the quantity I'm interested in $a$, which I can calculate using Pythagoras' theorem if I know $b$ and $c$. I know $c$, which is the length of vector $(x_3 - x_1,y_3 - y_1)$, given by, $$c = sqrt{(x_3 - x_1)^2 + (y_3 - y_1)^2}$$ So, now I need to calculate $b$: the length of a vector – that I'll call $vec{u}$ – that is perpendicular to $vec{v}$ and passes through point $(x_3, y_3)$. For $vec{u}$ and $vec{v}$ to be perpendicular the dot product must be zero. That is,



      $$vec{v}cdot vec{u}=0$$



      $$(x_4-x_3)(x_2-x_1)+(y_4-y_3)(y_2-y_1)=0$$



      This is where I begin to falter: one equation with two unknowns, $y_4$ & $x_4$. I expect there is some obvious constraint on $vec{u}$ that I should be using to eliminate an unknown, but my sleep-deprived mind is offering no help. Can someone point out what I've missed?



      $$$$





      $^*$I really want to use the word project to describe how my arbitrary point $(x_3, y_3)$ is placed along that vector. Is this the correct terminology?







      geometry






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Nov 28 at 17:26

























      asked Nov 28 at 17:19









      Lyngbakr

      1084




      1084






















          2 Answers
          2






          active

          oldest

          votes


















          1














          You are right in calling this a projection. If $(x_1,y_1)$ is the origin, then you can project ${bf u} = (x_3,y_3)$ onto $bf v$ thus:



          $${rm proj}_{bf v}{bf u} = frac{bf u cdot v}{bf v cdot v}{bf v}.$$



          If $(x_1,y_1)$ is not the origin, then just shift the frame of reference to make it so.






          share|cite|improve this answer

















          • 1




            See also the Wikipedia article on vector projection.
            – Théophile
            Nov 28 at 17:46










          • Perfect! Thanks.
            – Lyngbakr
            Nov 28 at 18:03



















          0














          Consider the vectors $v_1 = (x_2-x_1,y_2-y_1)$ and $v_2 = (x_3-x_1,y_3-y_1)$. You can compute the cosine of the angle between these two vectors as follows:



          $cos theta = frac{<v_1,v_2>}{||v_1||||v_2||}$,



          where $<v_1,v_2>$ is the dot-product and $||.||$ is the norm. Once you have done this computation, it is easy to see that $a = c cos theta$ and $b = c sin theta$.



          The quantity $a$ is the projection you speak of and it is related to the dot-product as described above.






          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',
            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%2f3017416%2fdistance-an-arbitrary-point-is-found-along-a-given-vector%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














            You are right in calling this a projection. If $(x_1,y_1)$ is the origin, then you can project ${bf u} = (x_3,y_3)$ onto $bf v$ thus:



            $${rm proj}_{bf v}{bf u} = frac{bf u cdot v}{bf v cdot v}{bf v}.$$



            If $(x_1,y_1)$ is not the origin, then just shift the frame of reference to make it so.






            share|cite|improve this answer

















            • 1




              See also the Wikipedia article on vector projection.
              – Théophile
              Nov 28 at 17:46










            • Perfect! Thanks.
              – Lyngbakr
              Nov 28 at 18:03
















            1














            You are right in calling this a projection. If $(x_1,y_1)$ is the origin, then you can project ${bf u} = (x_3,y_3)$ onto $bf v$ thus:



            $${rm proj}_{bf v}{bf u} = frac{bf u cdot v}{bf v cdot v}{bf v}.$$



            If $(x_1,y_1)$ is not the origin, then just shift the frame of reference to make it so.






            share|cite|improve this answer

















            • 1




              See also the Wikipedia article on vector projection.
              – Théophile
              Nov 28 at 17:46










            • Perfect! Thanks.
              – Lyngbakr
              Nov 28 at 18:03














            1












            1








            1






            You are right in calling this a projection. If $(x_1,y_1)$ is the origin, then you can project ${bf u} = (x_3,y_3)$ onto $bf v$ thus:



            $${rm proj}_{bf v}{bf u} = frac{bf u cdot v}{bf v cdot v}{bf v}.$$



            If $(x_1,y_1)$ is not the origin, then just shift the frame of reference to make it so.






            share|cite|improve this answer












            You are right in calling this a projection. If $(x_1,y_1)$ is the origin, then you can project ${bf u} = (x_3,y_3)$ onto $bf v$ thus:



            $${rm proj}_{bf v}{bf u} = frac{bf u cdot v}{bf v cdot v}{bf v}.$$



            If $(x_1,y_1)$ is not the origin, then just shift the frame of reference to make it so.







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Nov 28 at 17:45









            Théophile

            19.4k12946




            19.4k12946








            • 1




              See also the Wikipedia article on vector projection.
              – Théophile
              Nov 28 at 17:46










            • Perfect! Thanks.
              – Lyngbakr
              Nov 28 at 18:03














            • 1




              See also the Wikipedia article on vector projection.
              – Théophile
              Nov 28 at 17:46










            • Perfect! Thanks.
              – Lyngbakr
              Nov 28 at 18:03








            1




            1




            See also the Wikipedia article on vector projection.
            – Théophile
            Nov 28 at 17:46




            See also the Wikipedia article on vector projection.
            – Théophile
            Nov 28 at 17:46












            Perfect! Thanks.
            – Lyngbakr
            Nov 28 at 18:03




            Perfect! Thanks.
            – Lyngbakr
            Nov 28 at 18:03











            0














            Consider the vectors $v_1 = (x_2-x_1,y_2-y_1)$ and $v_2 = (x_3-x_1,y_3-y_1)$. You can compute the cosine of the angle between these two vectors as follows:



            $cos theta = frac{<v_1,v_2>}{||v_1||||v_2||}$,



            where $<v_1,v_2>$ is the dot-product and $||.||$ is the norm. Once you have done this computation, it is easy to see that $a = c cos theta$ and $b = c sin theta$.



            The quantity $a$ is the projection you speak of and it is related to the dot-product as described above.






            share|cite|improve this answer


























              0














              Consider the vectors $v_1 = (x_2-x_1,y_2-y_1)$ and $v_2 = (x_3-x_1,y_3-y_1)$. You can compute the cosine of the angle between these two vectors as follows:



              $cos theta = frac{<v_1,v_2>}{||v_1||||v_2||}$,



              where $<v_1,v_2>$ is the dot-product and $||.||$ is the norm. Once you have done this computation, it is easy to see that $a = c cos theta$ and $b = c sin theta$.



              The quantity $a$ is the projection you speak of and it is related to the dot-product as described above.






              share|cite|improve this answer
























                0












                0








                0






                Consider the vectors $v_1 = (x_2-x_1,y_2-y_1)$ and $v_2 = (x_3-x_1,y_3-y_1)$. You can compute the cosine of the angle between these two vectors as follows:



                $cos theta = frac{<v_1,v_2>}{||v_1||||v_2||}$,



                where $<v_1,v_2>$ is the dot-product and $||.||$ is the norm. Once you have done this computation, it is easy to see that $a = c cos theta$ and $b = c sin theta$.



                The quantity $a$ is the projection you speak of and it is related to the dot-product as described above.






                share|cite|improve this answer












                Consider the vectors $v_1 = (x_2-x_1,y_2-y_1)$ and $v_2 = (x_3-x_1,y_3-y_1)$. You can compute the cosine of the angle between these two vectors as follows:



                $cos theta = frac{<v_1,v_2>}{||v_1||||v_2||}$,



                where $<v_1,v_2>$ is the dot-product and $||.||$ is the norm. Once you have done this computation, it is easy to see that $a = c cos theta$ and $b = c sin theta$.



                The quantity $a$ is the projection you speak of and it is related to the dot-product as described above.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Nov 28 at 17:48









                Aditya Dua

                80418




                80418






























                    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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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.


                    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%2f3017416%2fdistance-an-arbitrary-point-is-found-along-a-given-vector%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

                    Tonle Sap (See)

                    I get strange results when I access the Sqlitedatabase with Unity C# via XAMPP

                    Guatemaltekische Davis-Cup-Mannschaft