Reflecting a vector over another line

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











up vote
3
down vote

favorite
3












So I'm really stuck with this math problem lately. I have a ray that is set along another line and gets reflected. What i am trying to do is to simply get reflected line's equation ($y = mx + c$). However, i think i should be using vectors. The problem is, even tho generally I understand them, I just can't get over how to use them in this case. I'm a senior so i haven't touched this topic yet and I need a little bit of help for my programming project.



I have two line equations and a point that the actual ray hits. I found this formula $r=d−2(d cdot n)n$ where $r$ is the reflected line's vector, $n$ is the normal of a mirror, $d$ is the incident ray. How do i actually use these equations as vectors?!



an example is shown here



enter image description here



-Any help is reeaaally appreciated. Thaaanks!:))







share|cite|improve this question






















  • Your pink line has vector form $r=(x,y)=(x, frac23x+frac83)=(0,frac83)+x(1,frac23)$ which has direction $(1,frac23)$. A normal vector to the pink line is then $n = (-frac23,1)$ - check this is perpendicular to the direction of the pink line. Find the direction of the red line and hence the direction of the yellow one.
    – Paul
    Apr 17 '17 at 22:53















up vote
3
down vote

favorite
3












So I'm really stuck with this math problem lately. I have a ray that is set along another line and gets reflected. What i am trying to do is to simply get reflected line's equation ($y = mx + c$). However, i think i should be using vectors. The problem is, even tho generally I understand them, I just can't get over how to use them in this case. I'm a senior so i haven't touched this topic yet and I need a little bit of help for my programming project.



I have two line equations and a point that the actual ray hits. I found this formula $r=d−2(d cdot n)n$ where $r$ is the reflected line's vector, $n$ is the normal of a mirror, $d$ is the incident ray. How do i actually use these equations as vectors?!



an example is shown here



enter image description here



-Any help is reeaaally appreciated. Thaaanks!:))







share|cite|improve this question






















  • Your pink line has vector form $r=(x,y)=(x, frac23x+frac83)=(0,frac83)+x(1,frac23)$ which has direction $(1,frac23)$. A normal vector to the pink line is then $n = (-frac23,1)$ - check this is perpendicular to the direction of the pink line. Find the direction of the red line and hence the direction of the yellow one.
    – Paul
    Apr 17 '17 at 22:53













up vote
3
down vote

favorite
3









up vote
3
down vote

favorite
3






3





So I'm really stuck with this math problem lately. I have a ray that is set along another line and gets reflected. What i am trying to do is to simply get reflected line's equation ($y = mx + c$). However, i think i should be using vectors. The problem is, even tho generally I understand them, I just can't get over how to use them in this case. I'm a senior so i haven't touched this topic yet and I need a little bit of help for my programming project.



I have two line equations and a point that the actual ray hits. I found this formula $r=d−2(d cdot n)n$ where $r$ is the reflected line's vector, $n$ is the normal of a mirror, $d$ is the incident ray. How do i actually use these equations as vectors?!



an example is shown here



enter image description here



-Any help is reeaaally appreciated. Thaaanks!:))







share|cite|improve this question














So I'm really stuck with this math problem lately. I have a ray that is set along another line and gets reflected. What i am trying to do is to simply get reflected line's equation ($y = mx + c$). However, i think i should be using vectors. The problem is, even tho generally I understand them, I just can't get over how to use them in this case. I'm a senior so i haven't touched this topic yet and I need a little bit of help for my programming project.



I have two line equations and a point that the actual ray hits. I found this formula $r=d−2(d cdot n)n$ where $r$ is the reflected line's vector, $n$ is the normal of a mirror, $d$ is the incident ray. How do i actually use these equations as vectors?!



an example is shown here



enter image description here



-Any help is reeaaally appreciated. Thaaanks!:))









share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Apr 17 '17 at 22:05









mathreadler

13.8k72058




13.8k72058










asked Apr 17 '17 at 21:58









matkenis

213




213











  • Your pink line has vector form $r=(x,y)=(x, frac23x+frac83)=(0,frac83)+x(1,frac23)$ which has direction $(1,frac23)$. A normal vector to the pink line is then $n = (-frac23,1)$ - check this is perpendicular to the direction of the pink line. Find the direction of the red line and hence the direction of the yellow one.
    – Paul
    Apr 17 '17 at 22:53

















  • Your pink line has vector form $r=(x,y)=(x, frac23x+frac83)=(0,frac83)+x(1,frac23)$ which has direction $(1,frac23)$. A normal vector to the pink line is then $n = (-frac23,1)$ - check this is perpendicular to the direction of the pink line. Find the direction of the red line and hence the direction of the yellow one.
    – Paul
    Apr 17 '17 at 22:53
















Your pink line has vector form $r=(x,y)=(x, frac23x+frac83)=(0,frac83)+x(1,frac23)$ which has direction $(1,frac23)$. A normal vector to the pink line is then $n = (-frac23,1)$ - check this is perpendicular to the direction of the pink line. Find the direction of the red line and hence the direction of the yellow one.
– Paul
Apr 17 '17 at 22:53





Your pink line has vector form $r=(x,y)=(x, frac23x+frac83)=(0,frac83)+x(1,frac23)$ which has direction $(1,frac23)$. A normal vector to the pink line is then $n = (-frac23,1)$ - check this is perpendicular to the direction of the pink line. Find the direction of the red line and hence the direction of the yellow one.
– Paul
Apr 17 '17 at 22:53











3 Answers
3






active

oldest

votes

















up vote
0
down vote













Here is another option. There is a formula for the angle between two lines, given their slopes.
beginalignat*1
tanDeltatheta & =frack_1-k_21+k_1k_2.
endalignat*
So $k_1=-frac13$ (red), $k_2=-frac32$ (green), $k_3=??$
(yellow), and then solve the equation for $k_3$:
beginalignat*1
frack_1-k_21+k_1k_2 & =frack_2-k_31+k_2k_3.
endalignat*






share|cite|improve this answer



























    up vote
    0
    down vote













    It is clear that your problem will be the same if you shift point $A$ at the origin, with lines



    • line $y=(-1/3)x$ whose directing vector is $binom-31$


    • and line of reflection $y=(2/3)x$ with directing vector $d=binom32$, that we will need normalized $n=binom3a2a$ where $a=tfrac1sqrt13$.


    Your formula, connects the incident vector $d$ and the reflected vector $r$



    $$tag1r=d−2(d cdot n)n$$



    If we apply (1) with the expressions of $d$ and $n$ given above, we get:



    $$r=binom3/1341/13$$



    which is the directing vector of line $y=mx$, meaning that $m=41/3$.



    The value of $c$ is obtained by expressing that $y=mx+c$ contains point $A(5,6)$ which means that $6=tfrac4135+c$, thus $c=-187/3.$




    The equation of the line $y=mx+c$ is thus $y=tfrac41x-1873$







    share|cite|improve this answer




















    • Thank you all for all these explanations!
      – matkenis
      Apr 18 '17 at 21:21

















    up vote
    0
    down vote













    Start by rearranging the equation of the mirror line into $frac23x-y=-frac83$. The normal form of the equation of a line is $mathbf ncdotmathbf x=textconst$, where $mathbf n$ is some vector normal (perpendicular) to the line. Comparing this to the mirror line equation, I see that a normal to it is $left(frac23,-1right)$. Since any normal will do, I’ll multiply this by $-3$ so that I don’t have to fiddle with as many fractions and so that the normal is on the same side of the line as the incident ray: $mathbf n=(-2,3)$.



    The incoming vector is $(1,m_textin)=(1,-1/3)$, which I’ll also multiply by $3$ to make the arithmetic simpler. Your reflection formula wants the normal to be a unit vector, but that can be dealt with by dividing by the length of $mathbf n$ twice, once for each appearance in the formula. This is somewhat nicer for calculation anyway, since $|mathbf n|^2=mathbf ncdotmathbf n$ so that there’s no need to compute square roots. So, for the reflected ray, we have $$mathbf r=mathbf d-2mathbf dcdotmathbf novermathbf ncdotmathbf nmathbf n = (3,-1)-2(3,-1)cdot(2,-3)over(2,-3)cdot(2,-3)(-2,3)=left(frac313,frac4113right).$$ Divide the $y$-coordinate by the $x$-coordinate to find the corresponding outgoing slope, which is $41/3$. You know that the ray hits the mirror at $(5,6)$, so the equation of the reflected line is $(y-6)=41over3(x-5)$, or $$y=41over3x-187over3.$$



    You can also work entirely with normal vectors because the normal of the reflected line is the same as the reflection of the incoming line’s normal. The incoming normal can be read from the equation: $(-1/3,-1)$, or $(1,3)$ to simplify the arithmetic. The reflection formula produces $left(frac4113,-frac313right)$, which you can verify is perpendicular to the vector $mathbf r$ computed previously. The equation of the outgoing line is then $41x-3y=dots$ (I’ve multiplied the entire equation by $13$ to eliminate the fractions.) Referring to the general normal equation at the top of this answer, it says that the dot product of $mathbf n$ with every point on the line is constant, so we can find this constant by taking the dot product with any known point—$(5,6)$ in this case. This gives $41x-3y=187$, which should be looking a bit familiar. Rearranging this equation to isolate $y$ produces the same one as computed previously.






    share|cite|improve this answer




















    • Thaanks for helping me out!
      – matkenis
      Apr 19 '17 at 8:27










    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: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    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%2f2239169%2freflecting-a-vector-over-another-line%23new-answer', 'question_page');

    );

    Post as a guest






























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Here is another option. There is a formula for the angle between two lines, given their slopes.
    beginalignat*1
    tanDeltatheta & =frack_1-k_21+k_1k_2.
    endalignat*
    So $k_1=-frac13$ (red), $k_2=-frac32$ (green), $k_3=??$
    (yellow), and then solve the equation for $k_3$:
    beginalignat*1
    frack_1-k_21+k_1k_2 & =frack_2-k_31+k_2k_3.
    endalignat*






    share|cite|improve this answer
























      up vote
      0
      down vote













      Here is another option. There is a formula for the angle between two lines, given their slopes.
      beginalignat*1
      tanDeltatheta & =frack_1-k_21+k_1k_2.
      endalignat*
      So $k_1=-frac13$ (red), $k_2=-frac32$ (green), $k_3=??$
      (yellow), and then solve the equation for $k_3$:
      beginalignat*1
      frack_1-k_21+k_1k_2 & =frack_2-k_31+k_2k_3.
      endalignat*






      share|cite|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Here is another option. There is a formula for the angle between two lines, given their slopes.
        beginalignat*1
        tanDeltatheta & =frack_1-k_21+k_1k_2.
        endalignat*
        So $k_1=-frac13$ (red), $k_2=-frac32$ (green), $k_3=??$
        (yellow), and then solve the equation for $k_3$:
        beginalignat*1
        frack_1-k_21+k_1k_2 & =frack_2-k_31+k_2k_3.
        endalignat*






        share|cite|improve this answer












        Here is another option. There is a formula for the angle between two lines, given their slopes.
        beginalignat*1
        tanDeltatheta & =frack_1-k_21+k_1k_2.
        endalignat*
        So $k_1=-frac13$ (red), $k_2=-frac32$ (green), $k_3=??$
        (yellow), and then solve the equation for $k_3$:
        beginalignat*1
        frack_1-k_21+k_1k_2 & =frack_2-k_31+k_2k_3.
        endalignat*







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Apr 17 '17 at 23:06









        James

        1,08768




        1,08768




















            up vote
            0
            down vote













            It is clear that your problem will be the same if you shift point $A$ at the origin, with lines



            • line $y=(-1/3)x$ whose directing vector is $binom-31$


            • and line of reflection $y=(2/3)x$ with directing vector $d=binom32$, that we will need normalized $n=binom3a2a$ where $a=tfrac1sqrt13$.


            Your formula, connects the incident vector $d$ and the reflected vector $r$



            $$tag1r=d−2(d cdot n)n$$



            If we apply (1) with the expressions of $d$ and $n$ given above, we get:



            $$r=binom3/1341/13$$



            which is the directing vector of line $y=mx$, meaning that $m=41/3$.



            The value of $c$ is obtained by expressing that $y=mx+c$ contains point $A(5,6)$ which means that $6=tfrac4135+c$, thus $c=-187/3.$




            The equation of the line $y=mx+c$ is thus $y=tfrac41x-1873$







            share|cite|improve this answer




















            • Thank you all for all these explanations!
              – matkenis
              Apr 18 '17 at 21:21














            up vote
            0
            down vote













            It is clear that your problem will be the same if you shift point $A$ at the origin, with lines



            • line $y=(-1/3)x$ whose directing vector is $binom-31$


            • and line of reflection $y=(2/3)x$ with directing vector $d=binom32$, that we will need normalized $n=binom3a2a$ where $a=tfrac1sqrt13$.


            Your formula, connects the incident vector $d$ and the reflected vector $r$



            $$tag1r=d−2(d cdot n)n$$



            If we apply (1) with the expressions of $d$ and $n$ given above, we get:



            $$r=binom3/1341/13$$



            which is the directing vector of line $y=mx$, meaning that $m=41/3$.



            The value of $c$ is obtained by expressing that $y=mx+c$ contains point $A(5,6)$ which means that $6=tfrac4135+c$, thus $c=-187/3.$




            The equation of the line $y=mx+c$ is thus $y=tfrac41x-1873$







            share|cite|improve this answer




















            • Thank you all for all these explanations!
              – matkenis
              Apr 18 '17 at 21:21












            up vote
            0
            down vote










            up vote
            0
            down vote









            It is clear that your problem will be the same if you shift point $A$ at the origin, with lines



            • line $y=(-1/3)x$ whose directing vector is $binom-31$


            • and line of reflection $y=(2/3)x$ with directing vector $d=binom32$, that we will need normalized $n=binom3a2a$ where $a=tfrac1sqrt13$.


            Your formula, connects the incident vector $d$ and the reflected vector $r$



            $$tag1r=d−2(d cdot n)n$$



            If we apply (1) with the expressions of $d$ and $n$ given above, we get:



            $$r=binom3/1341/13$$



            which is the directing vector of line $y=mx$, meaning that $m=41/3$.



            The value of $c$ is obtained by expressing that $y=mx+c$ contains point $A(5,6)$ which means that $6=tfrac4135+c$, thus $c=-187/3.$




            The equation of the line $y=mx+c$ is thus $y=tfrac41x-1873$







            share|cite|improve this answer












            It is clear that your problem will be the same if you shift point $A$ at the origin, with lines



            • line $y=(-1/3)x$ whose directing vector is $binom-31$


            • and line of reflection $y=(2/3)x$ with directing vector $d=binom32$, that we will need normalized $n=binom3a2a$ where $a=tfrac1sqrt13$.


            Your formula, connects the incident vector $d$ and the reflected vector $r$



            $$tag1r=d−2(d cdot n)n$$



            If we apply (1) with the expressions of $d$ and $n$ given above, we get:



            $$r=binom3/1341/13$$



            which is the directing vector of line $y=mx$, meaning that $m=41/3$.



            The value of $c$ is obtained by expressing that $y=mx+c$ contains point $A(5,6)$ which means that $6=tfrac4135+c$, thus $c=-187/3.$




            The equation of the line $y=mx+c$ is thus $y=tfrac41x-1873$








            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Apr 17 '17 at 23:59









            Jean Marie

            27.8k41847




            27.8k41847











            • Thank you all for all these explanations!
              – matkenis
              Apr 18 '17 at 21:21
















            • Thank you all for all these explanations!
              – matkenis
              Apr 18 '17 at 21:21















            Thank you all for all these explanations!
            – matkenis
            Apr 18 '17 at 21:21




            Thank you all for all these explanations!
            – matkenis
            Apr 18 '17 at 21:21










            up vote
            0
            down vote













            Start by rearranging the equation of the mirror line into $frac23x-y=-frac83$. The normal form of the equation of a line is $mathbf ncdotmathbf x=textconst$, where $mathbf n$ is some vector normal (perpendicular) to the line. Comparing this to the mirror line equation, I see that a normal to it is $left(frac23,-1right)$. Since any normal will do, I’ll multiply this by $-3$ so that I don’t have to fiddle with as many fractions and so that the normal is on the same side of the line as the incident ray: $mathbf n=(-2,3)$.



            The incoming vector is $(1,m_textin)=(1,-1/3)$, which I’ll also multiply by $3$ to make the arithmetic simpler. Your reflection formula wants the normal to be a unit vector, but that can be dealt with by dividing by the length of $mathbf n$ twice, once for each appearance in the formula. This is somewhat nicer for calculation anyway, since $|mathbf n|^2=mathbf ncdotmathbf n$ so that there’s no need to compute square roots. So, for the reflected ray, we have $$mathbf r=mathbf d-2mathbf dcdotmathbf novermathbf ncdotmathbf nmathbf n = (3,-1)-2(3,-1)cdot(2,-3)over(2,-3)cdot(2,-3)(-2,3)=left(frac313,frac4113right).$$ Divide the $y$-coordinate by the $x$-coordinate to find the corresponding outgoing slope, which is $41/3$. You know that the ray hits the mirror at $(5,6)$, so the equation of the reflected line is $(y-6)=41over3(x-5)$, or $$y=41over3x-187over3.$$



            You can also work entirely with normal vectors because the normal of the reflected line is the same as the reflection of the incoming line’s normal. The incoming normal can be read from the equation: $(-1/3,-1)$, or $(1,3)$ to simplify the arithmetic. The reflection formula produces $left(frac4113,-frac313right)$, which you can verify is perpendicular to the vector $mathbf r$ computed previously. The equation of the outgoing line is then $41x-3y=dots$ (I’ve multiplied the entire equation by $13$ to eliminate the fractions.) Referring to the general normal equation at the top of this answer, it says that the dot product of $mathbf n$ with every point on the line is constant, so we can find this constant by taking the dot product with any known point—$(5,6)$ in this case. This gives $41x-3y=187$, which should be looking a bit familiar. Rearranging this equation to isolate $y$ produces the same one as computed previously.






            share|cite|improve this answer




















            • Thaanks for helping me out!
              – matkenis
              Apr 19 '17 at 8:27














            up vote
            0
            down vote













            Start by rearranging the equation of the mirror line into $frac23x-y=-frac83$. The normal form of the equation of a line is $mathbf ncdotmathbf x=textconst$, where $mathbf n$ is some vector normal (perpendicular) to the line. Comparing this to the mirror line equation, I see that a normal to it is $left(frac23,-1right)$. Since any normal will do, I’ll multiply this by $-3$ so that I don’t have to fiddle with as many fractions and so that the normal is on the same side of the line as the incident ray: $mathbf n=(-2,3)$.



            The incoming vector is $(1,m_textin)=(1,-1/3)$, which I’ll also multiply by $3$ to make the arithmetic simpler. Your reflection formula wants the normal to be a unit vector, but that can be dealt with by dividing by the length of $mathbf n$ twice, once for each appearance in the formula. This is somewhat nicer for calculation anyway, since $|mathbf n|^2=mathbf ncdotmathbf n$ so that there’s no need to compute square roots. So, for the reflected ray, we have $$mathbf r=mathbf d-2mathbf dcdotmathbf novermathbf ncdotmathbf nmathbf n = (3,-1)-2(3,-1)cdot(2,-3)over(2,-3)cdot(2,-3)(-2,3)=left(frac313,frac4113right).$$ Divide the $y$-coordinate by the $x$-coordinate to find the corresponding outgoing slope, which is $41/3$. You know that the ray hits the mirror at $(5,6)$, so the equation of the reflected line is $(y-6)=41over3(x-5)$, or $$y=41over3x-187over3.$$



            You can also work entirely with normal vectors because the normal of the reflected line is the same as the reflection of the incoming line’s normal. The incoming normal can be read from the equation: $(-1/3,-1)$, or $(1,3)$ to simplify the arithmetic. The reflection formula produces $left(frac4113,-frac313right)$, which you can verify is perpendicular to the vector $mathbf r$ computed previously. The equation of the outgoing line is then $41x-3y=dots$ (I’ve multiplied the entire equation by $13$ to eliminate the fractions.) Referring to the general normal equation at the top of this answer, it says that the dot product of $mathbf n$ with every point on the line is constant, so we can find this constant by taking the dot product with any known point—$(5,6)$ in this case. This gives $41x-3y=187$, which should be looking a bit familiar. Rearranging this equation to isolate $y$ produces the same one as computed previously.






            share|cite|improve this answer




















            • Thaanks for helping me out!
              – matkenis
              Apr 19 '17 at 8:27












            up vote
            0
            down vote










            up vote
            0
            down vote









            Start by rearranging the equation of the mirror line into $frac23x-y=-frac83$. The normal form of the equation of a line is $mathbf ncdotmathbf x=textconst$, where $mathbf n$ is some vector normal (perpendicular) to the line. Comparing this to the mirror line equation, I see that a normal to it is $left(frac23,-1right)$. Since any normal will do, I’ll multiply this by $-3$ so that I don’t have to fiddle with as many fractions and so that the normal is on the same side of the line as the incident ray: $mathbf n=(-2,3)$.



            The incoming vector is $(1,m_textin)=(1,-1/3)$, which I’ll also multiply by $3$ to make the arithmetic simpler. Your reflection formula wants the normal to be a unit vector, but that can be dealt with by dividing by the length of $mathbf n$ twice, once for each appearance in the formula. This is somewhat nicer for calculation anyway, since $|mathbf n|^2=mathbf ncdotmathbf n$ so that there’s no need to compute square roots. So, for the reflected ray, we have $$mathbf r=mathbf d-2mathbf dcdotmathbf novermathbf ncdotmathbf nmathbf n = (3,-1)-2(3,-1)cdot(2,-3)over(2,-3)cdot(2,-3)(-2,3)=left(frac313,frac4113right).$$ Divide the $y$-coordinate by the $x$-coordinate to find the corresponding outgoing slope, which is $41/3$. You know that the ray hits the mirror at $(5,6)$, so the equation of the reflected line is $(y-6)=41over3(x-5)$, or $$y=41over3x-187over3.$$



            You can also work entirely with normal vectors because the normal of the reflected line is the same as the reflection of the incoming line’s normal. The incoming normal can be read from the equation: $(-1/3,-1)$, or $(1,3)$ to simplify the arithmetic. The reflection formula produces $left(frac4113,-frac313right)$, which you can verify is perpendicular to the vector $mathbf r$ computed previously. The equation of the outgoing line is then $41x-3y=dots$ (I’ve multiplied the entire equation by $13$ to eliminate the fractions.) Referring to the general normal equation at the top of this answer, it says that the dot product of $mathbf n$ with every point on the line is constant, so we can find this constant by taking the dot product with any known point—$(5,6)$ in this case. This gives $41x-3y=187$, which should be looking a bit familiar. Rearranging this equation to isolate $y$ produces the same one as computed previously.






            share|cite|improve this answer












            Start by rearranging the equation of the mirror line into $frac23x-y=-frac83$. The normal form of the equation of a line is $mathbf ncdotmathbf x=textconst$, where $mathbf n$ is some vector normal (perpendicular) to the line. Comparing this to the mirror line equation, I see that a normal to it is $left(frac23,-1right)$. Since any normal will do, I’ll multiply this by $-3$ so that I don’t have to fiddle with as many fractions and so that the normal is on the same side of the line as the incident ray: $mathbf n=(-2,3)$.



            The incoming vector is $(1,m_textin)=(1,-1/3)$, which I’ll also multiply by $3$ to make the arithmetic simpler. Your reflection formula wants the normal to be a unit vector, but that can be dealt with by dividing by the length of $mathbf n$ twice, once for each appearance in the formula. This is somewhat nicer for calculation anyway, since $|mathbf n|^2=mathbf ncdotmathbf n$ so that there’s no need to compute square roots. So, for the reflected ray, we have $$mathbf r=mathbf d-2mathbf dcdotmathbf novermathbf ncdotmathbf nmathbf n = (3,-1)-2(3,-1)cdot(2,-3)over(2,-3)cdot(2,-3)(-2,3)=left(frac313,frac4113right).$$ Divide the $y$-coordinate by the $x$-coordinate to find the corresponding outgoing slope, which is $41/3$. You know that the ray hits the mirror at $(5,6)$, so the equation of the reflected line is $(y-6)=41over3(x-5)$, or $$y=41over3x-187over3.$$



            You can also work entirely with normal vectors because the normal of the reflected line is the same as the reflection of the incoming line’s normal. The incoming normal can be read from the equation: $(-1/3,-1)$, or $(1,3)$ to simplify the arithmetic. The reflection formula produces $left(frac4113,-frac313right)$, which you can verify is perpendicular to the vector $mathbf r$ computed previously. The equation of the outgoing line is then $41x-3y=dots$ (I’ve multiplied the entire equation by $13$ to eliminate the fractions.) Referring to the general normal equation at the top of this answer, it says that the dot product of $mathbf n$ with every point on the line is constant, so we can find this constant by taking the dot product with any known point—$(5,6)$ in this case. This gives $41x-3y=187$, which should be looking a bit familiar. Rearranging this equation to isolate $y$ produces the same one as computed previously.







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Apr 18 '17 at 0:00









            amd

            26.7k21046




            26.7k21046











            • Thaanks for helping me out!
              – matkenis
              Apr 19 '17 at 8:27
















            • Thaanks for helping me out!
              – matkenis
              Apr 19 '17 at 8:27















            Thaanks for helping me out!
            – matkenis
            Apr 19 '17 at 8:27




            Thaanks for helping me out!
            – matkenis
            Apr 19 '17 at 8:27

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2239169%2freflecting-a-vector-over-another-line%23new-answer', 'question_page');

            );

            Post as a guest













































































            這個網誌中的熱門文章

            How to combine Bézier curves to a surface?

            Mutual Information Always Non-negative

            Why am i infinitely getting the same tweet with the Twitter Search API?