How to find a normal vector in 2D The 2019 Stack Overflow Developer Survey Results Are Inpoint deflecting off of a circlecollision point of circle and lineHow to calculate the different angles the normal of a plane makes with the different axis in a 3D space?Movement of a 3D point along its direction vectorHaving a vector, how can you interpolate a specific interception point on that vector?How to rotate / transform a vector so that it is parallel to a plane?Get the side of a rectangle at contact with another rectanglePosition function of a point moving in a circle with velocity $v_0$ and initial position $r_0$ with reflection.How to find third unknown plane, knowing all planes intersect at 1 point given only the x value?Calculate the constant acceleration needed for the discrete time trajectory to intersect a given target pointFinding a vector equation for the tangent line of curve formed by the intersection of two cylinders

Worn-tile Scrabble

Old scifi movie from the 50s or 60s with men in solid red uniforms who interrogate a spy from the past

Why “相同意思的词” is called “同义词” instead of "同意词"?

Can a flute soloist sit?

Why was M87 targeted for the Event Horizon Telescope instead of Sagittarius A*?

What do these terms in Caesar's Gallic wars mean?

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

Is bread bad for ducks?

How to charge AirPods to keep battery healthy?

How to display lines in a file like ls displays files in a directory?

Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?

Are turbopumps lubricated?

Is it possible for absolutely everyone to attain enlightenment?

How to support a colleague who finds meetings extremely tiring?

Why can't devices on different VLANs, but on the same subnet, communicate?

How can I add encounters in the Lost Mine of Phandelver campaign without giving PCs too much XP?

If a sorcerer casts the Banishment spell on a PC while in Avernus, does the PC return to their home plane?

Currents/voltages graph for an electrical circuit

Mathematics of imaging the black hole

Why are there uneven bright areas in this photo of black hole?

How much of the clove should I use when using big garlic heads?

Does adding complexity mean a more secure cipher?

Did any laptop computers have a built-in 5 1/4 inch floppy drive?

Why couldn't they take pictures of a closer black hole?



How to find a normal vector in 2D



The 2019 Stack Overflow Developer Survey Results Are Inpoint deflecting off of a circlecollision point of circle and lineHow to calculate the different angles the normal of a plane makes with the different axis in a 3D space?Movement of a 3D point along its direction vectorHaving a vector, how can you interpolate a specific interception point on that vector?How to rotate / transform a vector so that it is parallel to a plane?Get the side of a rectangle at contact with another rectanglePosition function of a point moving in a circle with velocity $v_0$ and initial position $r_0$ with reflection.How to find third unknown plane, knowing all planes intersect at 1 point given only the x value?Calculate the constant acceleration needed for the discrete time trajectory to intersect a given target pointFinding a vector equation for the tangent line of curve formed by the intersection of two cylinders










1












$begingroup$


I hope this is not a stupid question. I am having a hard time finding a normal in 2D. I am working on a game project and I am trying to perform vector reflection during collision. I know the rest of the math, but I am having a hard time creating the normal vector that is required.



Is there a way to build a normal vector from the point of collision? What do I need to create the normal vector? My position vector does not necessarily point in the direction of the object. My position can be (100, 200) but the object is a vertical object for example. What else can I do for this?



enter image description here










share|cite|improve this question











$endgroup$











  • $begingroup$
    The normal vector is perpendicular to the surface...
    $endgroup$
    – mniip
    Jul 19 '15 at 2:17






  • 1




    $begingroup$
    I think you can upload your picture somewhere else and post a link
    $endgroup$
    – coldnumber
    Jul 19 '15 at 2:20










  • $begingroup$
    In two dimensions, a vector normal to the vector $(a,b)$ is $(-b,a)$ (or any multiple thereof).
    $endgroup$
    – Greg Martin
    Jul 19 '15 at 2:52










  • $begingroup$
    I added an image
    $endgroup$
    – Ethosik
    Jul 19 '15 at 16:47










  • $begingroup$
    How are you defining the collision surfaces?
    $endgroup$
    – K. Rmth
    Jul 19 '15 at 17:14















1












$begingroup$


I hope this is not a stupid question. I am having a hard time finding a normal in 2D. I am working on a game project and I am trying to perform vector reflection during collision. I know the rest of the math, but I am having a hard time creating the normal vector that is required.



Is there a way to build a normal vector from the point of collision? What do I need to create the normal vector? My position vector does not necessarily point in the direction of the object. My position can be (100, 200) but the object is a vertical object for example. What else can I do for this?



enter image description here










share|cite|improve this question











$endgroup$











  • $begingroup$
    The normal vector is perpendicular to the surface...
    $endgroup$
    – mniip
    Jul 19 '15 at 2:17






  • 1




    $begingroup$
    I think you can upload your picture somewhere else and post a link
    $endgroup$
    – coldnumber
    Jul 19 '15 at 2:20










  • $begingroup$
    In two dimensions, a vector normal to the vector $(a,b)$ is $(-b,a)$ (or any multiple thereof).
    $endgroup$
    – Greg Martin
    Jul 19 '15 at 2:52










  • $begingroup$
    I added an image
    $endgroup$
    – Ethosik
    Jul 19 '15 at 16:47










  • $begingroup$
    How are you defining the collision surfaces?
    $endgroup$
    – K. Rmth
    Jul 19 '15 at 17:14













1












1








1





$begingroup$


I hope this is not a stupid question. I am having a hard time finding a normal in 2D. I am working on a game project and I am trying to perform vector reflection during collision. I know the rest of the math, but I am having a hard time creating the normal vector that is required.



Is there a way to build a normal vector from the point of collision? What do I need to create the normal vector? My position vector does not necessarily point in the direction of the object. My position can be (100, 200) but the object is a vertical object for example. What else can I do for this?



enter image description here










share|cite|improve this question











$endgroup$




I hope this is not a stupid question. I am having a hard time finding a normal in 2D. I am working on a game project and I am trying to perform vector reflection during collision. I know the rest of the math, but I am having a hard time creating the normal vector that is required.



Is there a way to build a normal vector from the point of collision? What do I need to create the normal vector? My position vector does not necessarily point in the direction of the object. My position can be (100, 200) but the object is a vertical object for example. What else can I do for this?



enter image description here







vectors






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jul 19 '15 at 17:18









K. Rmth

1,454822




1,454822










asked Jul 19 '15 at 1:39









EthosikEthosik

62




62











  • $begingroup$
    The normal vector is perpendicular to the surface...
    $endgroup$
    – mniip
    Jul 19 '15 at 2:17






  • 1




    $begingroup$
    I think you can upload your picture somewhere else and post a link
    $endgroup$
    – coldnumber
    Jul 19 '15 at 2:20










  • $begingroup$
    In two dimensions, a vector normal to the vector $(a,b)$ is $(-b,a)$ (or any multiple thereof).
    $endgroup$
    – Greg Martin
    Jul 19 '15 at 2:52










  • $begingroup$
    I added an image
    $endgroup$
    – Ethosik
    Jul 19 '15 at 16:47










  • $begingroup$
    How are you defining the collision surfaces?
    $endgroup$
    – K. Rmth
    Jul 19 '15 at 17:14
















  • $begingroup$
    The normal vector is perpendicular to the surface...
    $endgroup$
    – mniip
    Jul 19 '15 at 2:17






  • 1




    $begingroup$
    I think you can upload your picture somewhere else and post a link
    $endgroup$
    – coldnumber
    Jul 19 '15 at 2:20










  • $begingroup$
    In two dimensions, a vector normal to the vector $(a,b)$ is $(-b,a)$ (or any multiple thereof).
    $endgroup$
    – Greg Martin
    Jul 19 '15 at 2:52










  • $begingroup$
    I added an image
    $endgroup$
    – Ethosik
    Jul 19 '15 at 16:47










  • $begingroup$
    How are you defining the collision surfaces?
    $endgroup$
    – K. Rmth
    Jul 19 '15 at 17:14















$begingroup$
The normal vector is perpendicular to the surface...
$endgroup$
– mniip
Jul 19 '15 at 2:17




$begingroup$
The normal vector is perpendicular to the surface...
$endgroup$
– mniip
Jul 19 '15 at 2:17




1




1




$begingroup$
I think you can upload your picture somewhere else and post a link
$endgroup$
– coldnumber
Jul 19 '15 at 2:20




$begingroup$
I think you can upload your picture somewhere else and post a link
$endgroup$
– coldnumber
Jul 19 '15 at 2:20












$begingroup$
In two dimensions, a vector normal to the vector $(a,b)$ is $(-b,a)$ (or any multiple thereof).
$endgroup$
– Greg Martin
Jul 19 '15 at 2:52




$begingroup$
In two dimensions, a vector normal to the vector $(a,b)$ is $(-b,a)$ (or any multiple thereof).
$endgroup$
– Greg Martin
Jul 19 '15 at 2:52












$begingroup$
I added an image
$endgroup$
– Ethosik
Jul 19 '15 at 16:47




$begingroup$
I added an image
$endgroup$
– Ethosik
Jul 19 '15 at 16:47












$begingroup$
How are you defining the collision surfaces?
$endgroup$
– K. Rmth
Jul 19 '15 at 17:14




$begingroup$
How are you defining the collision surfaces?
$endgroup$
– K. Rmth
Jul 19 '15 at 17:14










2 Answers
2






active

oldest

votes


















0












$begingroup$

enter image description here



$vec V_reflected =vec V_incident -2vec n(vec V_incident cdot vec n)$






share|cite|improve this answer









$endgroup$




















    -1












    $begingroup$

    I also had this problem. you can do $vecv times vecp$ and consider $x$ and $y$ coordinates only.



    In fact for any $vecv=(x,y,0)$ and $vecp=(0,0,1)$ then $vecv times vecp=beginbmatrixveci & vecj & veck\x & y & z \ 0 & 0 & 1endbmatrix = yveci-xvecj+0veck=(y,-x)$



    That implies that the normal vector $vecn=(vecVy, -vecVx)$






    share|cite|improve this answer











    $endgroup$












    • $begingroup$
      The OP used $vec v$ for the velocity of the ball and $vec p$ for the position of the center of the rectangle. Those two things do not determine the direction of the normal vector at all, so it is really unclear what you think you are doing with the formulas in this answer.
      $endgroup$
      – David K
      Jul 29 '16 at 15:52











    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%2f1366096%2fhow-to-find-a-normal-vector-in-2d%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









    0












    $begingroup$

    enter image description here



    $vec V_reflected =vec V_incident -2vec n(vec V_incident cdot vec n)$






    share|cite|improve this answer









    $endgroup$

















      0












      $begingroup$

      enter image description here



      $vec V_reflected =vec V_incident -2vec n(vec V_incident cdot vec n)$






      share|cite|improve this answer









      $endgroup$















        0












        0








        0





        $begingroup$

        enter image description here



        $vec V_reflected =vec V_incident -2vec n(vec V_incident cdot vec n)$






        share|cite|improve this answer









        $endgroup$



        enter image description here



        $vec V_reflected =vec V_incident -2vec n(vec V_incident cdot vec n)$







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Jul 19 '15 at 19:32









        K. RmthK. Rmth

        1,454822




        1,454822





















            -1












            $begingroup$

            I also had this problem. you can do $vecv times vecp$ and consider $x$ and $y$ coordinates only.



            In fact for any $vecv=(x,y,0)$ and $vecp=(0,0,1)$ then $vecv times vecp=beginbmatrixveci & vecj & veck\x & y & z \ 0 & 0 & 1endbmatrix = yveci-xvecj+0veck=(y,-x)$



            That implies that the normal vector $vecn=(vecVy, -vecVx)$






            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              The OP used $vec v$ for the velocity of the ball and $vec p$ for the position of the center of the rectangle. Those two things do not determine the direction of the normal vector at all, so it is really unclear what you think you are doing with the formulas in this answer.
              $endgroup$
              – David K
              Jul 29 '16 at 15:52















            -1












            $begingroup$

            I also had this problem. you can do $vecv times vecp$ and consider $x$ and $y$ coordinates only.



            In fact for any $vecv=(x,y,0)$ and $vecp=(0,0,1)$ then $vecv times vecp=beginbmatrixveci & vecj & veck\x & y & z \ 0 & 0 & 1endbmatrix = yveci-xvecj+0veck=(y,-x)$



            That implies that the normal vector $vecn=(vecVy, -vecVx)$






            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              The OP used $vec v$ for the velocity of the ball and $vec p$ for the position of the center of the rectangle. Those two things do not determine the direction of the normal vector at all, so it is really unclear what you think you are doing with the formulas in this answer.
              $endgroup$
              – David K
              Jul 29 '16 at 15:52













            -1












            -1








            -1





            $begingroup$

            I also had this problem. you can do $vecv times vecp$ and consider $x$ and $y$ coordinates only.



            In fact for any $vecv=(x,y,0)$ and $vecp=(0,0,1)$ then $vecv times vecp=beginbmatrixveci & vecj & veck\x & y & z \ 0 & 0 & 1endbmatrix = yveci-xvecj+0veck=(y,-x)$



            That implies that the normal vector $vecn=(vecVy, -vecVx)$






            share|cite|improve this answer











            $endgroup$



            I also had this problem. you can do $vecv times vecp$ and consider $x$ and $y$ coordinates only.



            In fact for any $vecv=(x,y,0)$ and $vecp=(0,0,1)$ then $vecv times vecp=beginbmatrixveci & vecj & veck\x & y & z \ 0 & 0 & 1endbmatrix = yveci-xvecj+0veck=(y,-x)$



            That implies that the normal vector $vecn=(vecVy, -vecVx)$







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited Jul 29 '16 at 15:34

























            answered Jul 27 '16 at 20:12









            Carlos AfonsoCarlos Afonso

            25329




            25329











            • $begingroup$
              The OP used $vec v$ for the velocity of the ball and $vec p$ for the position of the center of the rectangle. Those two things do not determine the direction of the normal vector at all, so it is really unclear what you think you are doing with the formulas in this answer.
              $endgroup$
              – David K
              Jul 29 '16 at 15:52
















            • $begingroup$
              The OP used $vec v$ for the velocity of the ball and $vec p$ for the position of the center of the rectangle. Those two things do not determine the direction of the normal vector at all, so it is really unclear what you think you are doing with the formulas in this answer.
              $endgroup$
              – David K
              Jul 29 '16 at 15:52















            $begingroup$
            The OP used $vec v$ for the velocity of the ball and $vec p$ for the position of the center of the rectangle. Those two things do not determine the direction of the normal vector at all, so it is really unclear what you think you are doing with the formulas in this answer.
            $endgroup$
            – David K
            Jul 29 '16 at 15:52




            $begingroup$
            The OP used $vec v$ for the velocity of the ball and $vec p$ for the position of the center of the rectangle. Those two things do not determine the direction of the normal vector at all, so it is really unclear what you think you are doing with the formulas in this answer.
            $endgroup$
            – David K
            Jul 29 '16 at 15:52

















            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%2f1366096%2fhow-to-find-a-normal-vector-in-2d%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

            Moe incest case Sentencing See also References Navigation menu"'Australian Josef Fritzl' fathered four children by daughter""Small town recoils in horror at 'Australian Fritzl' incest case""Victorian rape allegations echo Fritzl case - Just In (Australian Broadcasting Corporation)""Incest father jailed for 22 years""'Australian Fritzl' sentenced to 22 years in prison for abusing daughter for three decades""RSJ v The Queen"

            Who is our nearest planetary neighbor, on average?Santa Claus flies to the South PoleSeven Spheres of Unequal Mass, a weighing problem with a twistDescribe a large integerFast Mental Calculation of $7.5^7$Math in Space (without the help of celebrities)Find the value of $bigstar$: Puzzle 8 - InequalityWho drinks beer while running anyway?A Crucial DeliveryRanking And AverageHow long will my money last at roulette?

            Daza language Contents Vocabulary Phonology References External links Navigation menudaza1242Daza"Dazaga"eeee178086576