Can’t we use ‘vector product’ to find the angle between two vectors?












0












$begingroup$


There are two vectors : $A = (hat i + j + k)$ and $B = (hat i - hat j - hat k)$, where $hat i$, $hat j$, and $hat k$ are unit vectors along $x$, $y$, and $z$ axis respectively. We have to find the angle between these two vectors. Of course the best way to do that is by using ‘scalar product’. Scalar product of these two vectors gives $(-1)$, which is equal to $3costheta$
begin{align}
implies && -1 & = 3cos theta \
implies && theta & = arccos (-1/3) = 109° quad text{(approx)}
end{align}



Now if I use vector product, I get $A times B = (2hat j - 2hat k)$, so $|A times B| = sqrt{8}$, which is equal to $3sintheta$.



begin{align}
implies && sqrt{8} & = 3sin theta \
implies && theta & = arcsin (sqrt{8}/3) = 70.5° quad text{(approx)}
end{align}



Why aren't these two angles equal? Are they not supposed to be equal?










share|cite|improve this question











$endgroup$



migrated from physics.stackexchange.com Jan 16 at 9:53


This question came from our site for active researchers, academics and students of physics.


















  • $begingroup$
    Note that you can (and should!) use MathJax to typeset mathematics here; a good tutorial is here. (Also: presumably $B=(i-j-j)$ is a typo?)
    $endgroup$
    – E.P.
    Jan 15 at 19:19










  • $begingroup$
    the two angles have the same sinus : $sin(180-70) = sin(110)$
    $endgroup$
    – Vincent Fraticelli
    Jan 15 at 19:32






  • 2




    $begingroup$
    Would Mathematics be a better home for this question?
    $endgroup$
    – Qmechanic
    Jan 15 at 19:32










  • $begingroup$
    I think there is a typo in the definition of $B$
    $endgroup$
    – ja72
    Jan 15 at 19:44
















0












$begingroup$


There are two vectors : $A = (hat i + j + k)$ and $B = (hat i - hat j - hat k)$, where $hat i$, $hat j$, and $hat k$ are unit vectors along $x$, $y$, and $z$ axis respectively. We have to find the angle between these two vectors. Of course the best way to do that is by using ‘scalar product’. Scalar product of these two vectors gives $(-1)$, which is equal to $3costheta$
begin{align}
implies && -1 & = 3cos theta \
implies && theta & = arccos (-1/3) = 109° quad text{(approx)}
end{align}



Now if I use vector product, I get $A times B = (2hat j - 2hat k)$, so $|A times B| = sqrt{8}$, which is equal to $3sintheta$.



begin{align}
implies && sqrt{8} & = 3sin theta \
implies && theta & = arcsin (sqrt{8}/3) = 70.5° quad text{(approx)}
end{align}



Why aren't these two angles equal? Are they not supposed to be equal?










share|cite|improve this question











$endgroup$



migrated from physics.stackexchange.com Jan 16 at 9:53


This question came from our site for active researchers, academics and students of physics.


















  • $begingroup$
    Note that you can (and should!) use MathJax to typeset mathematics here; a good tutorial is here. (Also: presumably $B=(i-j-j)$ is a typo?)
    $endgroup$
    – E.P.
    Jan 15 at 19:19










  • $begingroup$
    the two angles have the same sinus : $sin(180-70) = sin(110)$
    $endgroup$
    – Vincent Fraticelli
    Jan 15 at 19:32






  • 2




    $begingroup$
    Would Mathematics be a better home for this question?
    $endgroup$
    – Qmechanic
    Jan 15 at 19:32










  • $begingroup$
    I think there is a typo in the definition of $B$
    $endgroup$
    – ja72
    Jan 15 at 19:44














0












0








0





$begingroup$


There are two vectors : $A = (hat i + j + k)$ and $B = (hat i - hat j - hat k)$, where $hat i$, $hat j$, and $hat k$ are unit vectors along $x$, $y$, and $z$ axis respectively. We have to find the angle between these two vectors. Of course the best way to do that is by using ‘scalar product’. Scalar product of these two vectors gives $(-1)$, which is equal to $3costheta$
begin{align}
implies && -1 & = 3cos theta \
implies && theta & = arccos (-1/3) = 109° quad text{(approx)}
end{align}



Now if I use vector product, I get $A times B = (2hat j - 2hat k)$, so $|A times B| = sqrt{8}$, which is equal to $3sintheta$.



begin{align}
implies && sqrt{8} & = 3sin theta \
implies && theta & = arcsin (sqrt{8}/3) = 70.5° quad text{(approx)}
end{align}



Why aren't these two angles equal? Are they not supposed to be equal?










share|cite|improve this question











$endgroup$




There are two vectors : $A = (hat i + j + k)$ and $B = (hat i - hat j - hat k)$, where $hat i$, $hat j$, and $hat k$ are unit vectors along $x$, $y$, and $z$ axis respectively. We have to find the angle between these two vectors. Of course the best way to do that is by using ‘scalar product’. Scalar product of these two vectors gives $(-1)$, which is equal to $3costheta$
begin{align}
implies && -1 & = 3cos theta \
implies && theta & = arccos (-1/3) = 109° quad text{(approx)}
end{align}



Now if I use vector product, I get $A times B = (2hat j - 2hat k)$, so $|A times B| = sqrt{8}$, which is equal to $3sintheta$.



begin{align}
implies && sqrt{8} & = 3sin theta \
implies && theta & = arcsin (sqrt{8}/3) = 70.5° quad text{(approx)}
end{align}



Why aren't these two angles equal? Are they not supposed to be equal?







vectors geometry






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 25 at 7:29







π times e

















asked Jan 15 at 19:14









π times eπ times e

10115




10115




migrated from physics.stackexchange.com Jan 16 at 9:53


This question came from our site for active researchers, academics and students of physics.









migrated from physics.stackexchange.com Jan 16 at 9:53


This question came from our site for active researchers, academics and students of physics.














  • $begingroup$
    Note that you can (and should!) use MathJax to typeset mathematics here; a good tutorial is here. (Also: presumably $B=(i-j-j)$ is a typo?)
    $endgroup$
    – E.P.
    Jan 15 at 19:19










  • $begingroup$
    the two angles have the same sinus : $sin(180-70) = sin(110)$
    $endgroup$
    – Vincent Fraticelli
    Jan 15 at 19:32






  • 2




    $begingroup$
    Would Mathematics be a better home for this question?
    $endgroup$
    – Qmechanic
    Jan 15 at 19:32










  • $begingroup$
    I think there is a typo in the definition of $B$
    $endgroup$
    – ja72
    Jan 15 at 19:44


















  • $begingroup$
    Note that you can (and should!) use MathJax to typeset mathematics here; a good tutorial is here. (Also: presumably $B=(i-j-j)$ is a typo?)
    $endgroup$
    – E.P.
    Jan 15 at 19:19










  • $begingroup$
    the two angles have the same sinus : $sin(180-70) = sin(110)$
    $endgroup$
    – Vincent Fraticelli
    Jan 15 at 19:32






  • 2




    $begingroup$
    Would Mathematics be a better home for this question?
    $endgroup$
    – Qmechanic
    Jan 15 at 19:32










  • $begingroup$
    I think there is a typo in the definition of $B$
    $endgroup$
    – ja72
    Jan 15 at 19:44
















$begingroup$
Note that you can (and should!) use MathJax to typeset mathematics here; a good tutorial is here. (Also: presumably $B=(i-j-j)$ is a typo?)
$endgroup$
– E.P.
Jan 15 at 19:19




$begingroup$
Note that you can (and should!) use MathJax to typeset mathematics here; a good tutorial is here. (Also: presumably $B=(i-j-j)$ is a typo?)
$endgroup$
– E.P.
Jan 15 at 19:19












$begingroup$
the two angles have the same sinus : $sin(180-70) = sin(110)$
$endgroup$
– Vincent Fraticelli
Jan 15 at 19:32




$begingroup$
the two angles have the same sinus : $sin(180-70) = sin(110)$
$endgroup$
– Vincent Fraticelli
Jan 15 at 19:32




2




2




$begingroup$
Would Mathematics be a better home for this question?
$endgroup$
– Qmechanic
Jan 15 at 19:32




$begingroup$
Would Mathematics be a better home for this question?
$endgroup$
– Qmechanic
Jan 15 at 19:32












$begingroup$
I think there is a typo in the definition of $B$
$endgroup$
– ja72
Jan 15 at 19:44




$begingroup$
I think there is a typo in the definition of $B$
$endgroup$
– ja72
Jan 15 at 19:44










3 Answers
3






active

oldest

votes


















4












$begingroup$

Your cross-product argument is faulty, because the inverse sine cannot distinguish between angles in the interval $[0,90°]$ and angles in the interval $[90°,180°]$.



The correct angle is that obtained from the scalar-product argument, $arccos(-1/3) approx 109°$, and you should be able to verify (numerically, at least) that this angle satisfies
$$
sinmathopen{}left(arccos(-1/3)right)mathclose{}
=
frac{sqrt{8}}{3}
= frac{||Atimes B||}{||A|| , ||B||}.
$$



The arc-sine, on the other hand, is always restricted to producing angles in the interval $[-90°,90°]$, which means that it reflects that $109.5°$ about the $90°$ mark to produce the $70.5°$ that you observe.



Because of this limitation, your vector-product method is unreliable and it shouldn't be used to calculate angles between vectors.






share|cite|improve this answer









$endgroup$





















    0












    $begingroup$

    In fact, neither the sine nor the cosine are sufficient to find an oriented angle. The cosine (dot product) gives the angle to the sign. The sinus is necessary to have the sign.
    In principle, therefore, both the vector product and the dot product should be used.






    share|cite|improve this answer









    $endgroup$













    • $begingroup$
      You can't have oriented angles in 3D.
      $endgroup$
      – E.P.
      Jan 15 at 20:36










    • $begingroup$
      OK. I was speaking of oriented angles which is not the question asked.
      $endgroup$
      – Vincent Fraticelli
      Jan 16 at 6:40



















    0












    $begingroup$

    I would argue to use both



    $$ | A times B | = | A | | B | sin theta $$
    $$ A cdot B = | A | | B | cos theta $$



    or



    $$ tan theta = frac{ | A times B |}{A cdot B} $$



    and computationally use the atan2(dy,dx) function



    Angle = atan2( cross(A,B), dot(A,B) ) = atan2( 2*sqrt(2),-1 ) = 1.910633r = 109.47122°


    The problem with calculating only the $sin(theta)$ is that the answer can only be between $[- tfrac{pi}{2} ldots tfrac{pi}{2} )$.



    Although the above also has the same domain as calculating $cos(theta)$ of $[0 ldots pi)$, it might be computationally faster since the magnitude of the vectors is never calculated (avoiding two sqrt()) calls.






    share|cite|improve this answer









    $endgroup$









    • 1




      $begingroup$
      So your method saves some two milliseconds in a calculation that used to take five milliseconds? (assuming that your assertion holds up, which is certainly not guaranteed.) Sounds like a useful method, if you're going to be doing this tens of thousands of times in your calculation - which is not the case for OP.
      $endgroup$
      – E.P.
      Jan 15 at 20:34










    • $begingroup$
      @EmilioPisanty - There is also the reason that when the vectors are really small near zero the division with the magnitude is unstable. The atan2() function is far more robust for the edge cases.
      $endgroup$
      – ja72
      Jan 15 at 21:18






    • 1




      $begingroup$
      All of that is completely moot. There's no hint of numerical analysis in the question.
      $endgroup$
      – E.P.
      Jan 15 at 22:19











    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%2f3075541%2fcan-t-we-use-vector-product-to-find-the-angle-between-two-vectors%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4












    $begingroup$

    Your cross-product argument is faulty, because the inverse sine cannot distinguish between angles in the interval $[0,90°]$ and angles in the interval $[90°,180°]$.



    The correct angle is that obtained from the scalar-product argument, $arccos(-1/3) approx 109°$, and you should be able to verify (numerically, at least) that this angle satisfies
    $$
    sinmathopen{}left(arccos(-1/3)right)mathclose{}
    =
    frac{sqrt{8}}{3}
    = frac{||Atimes B||}{||A|| , ||B||}.
    $$



    The arc-sine, on the other hand, is always restricted to producing angles in the interval $[-90°,90°]$, which means that it reflects that $109.5°$ about the $90°$ mark to produce the $70.5°$ that you observe.



    Because of this limitation, your vector-product method is unreliable and it shouldn't be used to calculate angles between vectors.






    share|cite|improve this answer









    $endgroup$


















      4












      $begingroup$

      Your cross-product argument is faulty, because the inverse sine cannot distinguish between angles in the interval $[0,90°]$ and angles in the interval $[90°,180°]$.



      The correct angle is that obtained from the scalar-product argument, $arccos(-1/3) approx 109°$, and you should be able to verify (numerically, at least) that this angle satisfies
      $$
      sinmathopen{}left(arccos(-1/3)right)mathclose{}
      =
      frac{sqrt{8}}{3}
      = frac{||Atimes B||}{||A|| , ||B||}.
      $$



      The arc-sine, on the other hand, is always restricted to producing angles in the interval $[-90°,90°]$, which means that it reflects that $109.5°$ about the $90°$ mark to produce the $70.5°$ that you observe.



      Because of this limitation, your vector-product method is unreliable and it shouldn't be used to calculate angles between vectors.






      share|cite|improve this answer









      $endgroup$
















        4












        4








        4





        $begingroup$

        Your cross-product argument is faulty, because the inverse sine cannot distinguish between angles in the interval $[0,90°]$ and angles in the interval $[90°,180°]$.



        The correct angle is that obtained from the scalar-product argument, $arccos(-1/3) approx 109°$, and you should be able to verify (numerically, at least) that this angle satisfies
        $$
        sinmathopen{}left(arccos(-1/3)right)mathclose{}
        =
        frac{sqrt{8}}{3}
        = frac{||Atimes B||}{||A|| , ||B||}.
        $$



        The arc-sine, on the other hand, is always restricted to producing angles in the interval $[-90°,90°]$, which means that it reflects that $109.5°$ about the $90°$ mark to produce the $70.5°$ that you observe.



        Because of this limitation, your vector-product method is unreliable and it shouldn't be used to calculate angles between vectors.






        share|cite|improve this answer









        $endgroup$



        Your cross-product argument is faulty, because the inverse sine cannot distinguish between angles in the interval $[0,90°]$ and angles in the interval $[90°,180°]$.



        The correct angle is that obtained from the scalar-product argument, $arccos(-1/3) approx 109°$, and you should be able to verify (numerically, at least) that this angle satisfies
        $$
        sinmathopen{}left(arccos(-1/3)right)mathclose{}
        =
        frac{sqrt{8}}{3}
        = frac{||Atimes B||}{||A|| , ||B||}.
        $$



        The arc-sine, on the other hand, is always restricted to producing angles in the interval $[-90°,90°]$, which means that it reflects that $109.5°$ about the $90°$ mark to produce the $70.5°$ that you observe.



        Because of this limitation, your vector-product method is unreliable and it shouldn't be used to calculate angles between vectors.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Jan 15 at 19:30









        E.P.E.P.

        1,5151125




        1,5151125























            0












            $begingroup$

            In fact, neither the sine nor the cosine are sufficient to find an oriented angle. The cosine (dot product) gives the angle to the sign. The sinus is necessary to have the sign.
            In principle, therefore, both the vector product and the dot product should be used.






            share|cite|improve this answer









            $endgroup$













            • $begingroup$
              You can't have oriented angles in 3D.
              $endgroup$
              – E.P.
              Jan 15 at 20:36










            • $begingroup$
              OK. I was speaking of oriented angles which is not the question asked.
              $endgroup$
              – Vincent Fraticelli
              Jan 16 at 6:40
















            0












            $begingroup$

            In fact, neither the sine nor the cosine are sufficient to find an oriented angle. The cosine (dot product) gives the angle to the sign. The sinus is necessary to have the sign.
            In principle, therefore, both the vector product and the dot product should be used.






            share|cite|improve this answer









            $endgroup$













            • $begingroup$
              You can't have oriented angles in 3D.
              $endgroup$
              – E.P.
              Jan 15 at 20:36










            • $begingroup$
              OK. I was speaking of oriented angles which is not the question asked.
              $endgroup$
              – Vincent Fraticelli
              Jan 16 at 6:40














            0












            0








            0





            $begingroup$

            In fact, neither the sine nor the cosine are sufficient to find an oriented angle. The cosine (dot product) gives the angle to the sign. The sinus is necessary to have the sign.
            In principle, therefore, both the vector product and the dot product should be used.






            share|cite|improve this answer









            $endgroup$



            In fact, neither the sine nor the cosine are sufficient to find an oriented angle. The cosine (dot product) gives the angle to the sign. The sinus is necessary to have the sign.
            In principle, therefore, both the vector product and the dot product should be used.







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Jan 15 at 19:45







            Vincent Fraticelli



















            • $begingroup$
              You can't have oriented angles in 3D.
              $endgroup$
              – E.P.
              Jan 15 at 20:36










            • $begingroup$
              OK. I was speaking of oriented angles which is not the question asked.
              $endgroup$
              – Vincent Fraticelli
              Jan 16 at 6:40


















            • $begingroup$
              You can't have oriented angles in 3D.
              $endgroup$
              – E.P.
              Jan 15 at 20:36










            • $begingroup$
              OK. I was speaking of oriented angles which is not the question asked.
              $endgroup$
              – Vincent Fraticelli
              Jan 16 at 6:40
















            $begingroup$
            You can't have oriented angles in 3D.
            $endgroup$
            – E.P.
            Jan 15 at 20:36




            $begingroup$
            You can't have oriented angles in 3D.
            $endgroup$
            – E.P.
            Jan 15 at 20:36












            $begingroup$
            OK. I was speaking of oriented angles which is not the question asked.
            $endgroup$
            – Vincent Fraticelli
            Jan 16 at 6:40




            $begingroup$
            OK. I was speaking of oriented angles which is not the question asked.
            $endgroup$
            – Vincent Fraticelli
            Jan 16 at 6:40











            0












            $begingroup$

            I would argue to use both



            $$ | A times B | = | A | | B | sin theta $$
            $$ A cdot B = | A | | B | cos theta $$



            or



            $$ tan theta = frac{ | A times B |}{A cdot B} $$



            and computationally use the atan2(dy,dx) function



            Angle = atan2( cross(A,B), dot(A,B) ) = atan2( 2*sqrt(2),-1 ) = 1.910633r = 109.47122°


            The problem with calculating only the $sin(theta)$ is that the answer can only be between $[- tfrac{pi}{2} ldots tfrac{pi}{2} )$.



            Although the above also has the same domain as calculating $cos(theta)$ of $[0 ldots pi)$, it might be computationally faster since the magnitude of the vectors is never calculated (avoiding two sqrt()) calls.






            share|cite|improve this answer









            $endgroup$









            • 1




              $begingroup$
              So your method saves some two milliseconds in a calculation that used to take five milliseconds? (assuming that your assertion holds up, which is certainly not guaranteed.) Sounds like a useful method, if you're going to be doing this tens of thousands of times in your calculation - which is not the case for OP.
              $endgroup$
              – E.P.
              Jan 15 at 20:34










            • $begingroup$
              @EmilioPisanty - There is also the reason that when the vectors are really small near zero the division with the magnitude is unstable. The atan2() function is far more robust for the edge cases.
              $endgroup$
              – ja72
              Jan 15 at 21:18






            • 1




              $begingroup$
              All of that is completely moot. There's no hint of numerical analysis in the question.
              $endgroup$
              – E.P.
              Jan 15 at 22:19
















            0












            $begingroup$

            I would argue to use both



            $$ | A times B | = | A | | B | sin theta $$
            $$ A cdot B = | A | | B | cos theta $$



            or



            $$ tan theta = frac{ | A times B |}{A cdot B} $$



            and computationally use the atan2(dy,dx) function



            Angle = atan2( cross(A,B), dot(A,B) ) = atan2( 2*sqrt(2),-1 ) = 1.910633r = 109.47122°


            The problem with calculating only the $sin(theta)$ is that the answer can only be between $[- tfrac{pi}{2} ldots tfrac{pi}{2} )$.



            Although the above also has the same domain as calculating $cos(theta)$ of $[0 ldots pi)$, it might be computationally faster since the magnitude of the vectors is never calculated (avoiding two sqrt()) calls.






            share|cite|improve this answer









            $endgroup$









            • 1




              $begingroup$
              So your method saves some two milliseconds in a calculation that used to take five milliseconds? (assuming that your assertion holds up, which is certainly not guaranteed.) Sounds like a useful method, if you're going to be doing this tens of thousands of times in your calculation - which is not the case for OP.
              $endgroup$
              – E.P.
              Jan 15 at 20:34










            • $begingroup$
              @EmilioPisanty - There is also the reason that when the vectors are really small near zero the division with the magnitude is unstable. The atan2() function is far more robust for the edge cases.
              $endgroup$
              – ja72
              Jan 15 at 21:18






            • 1




              $begingroup$
              All of that is completely moot. There's no hint of numerical analysis in the question.
              $endgroup$
              – E.P.
              Jan 15 at 22:19














            0












            0








            0





            $begingroup$

            I would argue to use both



            $$ | A times B | = | A | | B | sin theta $$
            $$ A cdot B = | A | | B | cos theta $$



            or



            $$ tan theta = frac{ | A times B |}{A cdot B} $$



            and computationally use the atan2(dy,dx) function



            Angle = atan2( cross(A,B), dot(A,B) ) = atan2( 2*sqrt(2),-1 ) = 1.910633r = 109.47122°


            The problem with calculating only the $sin(theta)$ is that the answer can only be between $[- tfrac{pi}{2} ldots tfrac{pi}{2} )$.



            Although the above also has the same domain as calculating $cos(theta)$ of $[0 ldots pi)$, it might be computationally faster since the magnitude of the vectors is never calculated (avoiding two sqrt()) calls.






            share|cite|improve this answer









            $endgroup$



            I would argue to use both



            $$ | A times B | = | A | | B | sin theta $$
            $$ A cdot B = | A | | B | cos theta $$



            or



            $$ tan theta = frac{ | A times B |}{A cdot B} $$



            and computationally use the atan2(dy,dx) function



            Angle = atan2( cross(A,B), dot(A,B) ) = atan2( 2*sqrt(2),-1 ) = 1.910633r = 109.47122°


            The problem with calculating only the $sin(theta)$ is that the answer can only be between $[- tfrac{pi}{2} ldots tfrac{pi}{2} )$.



            Although the above also has the same domain as calculating $cos(theta)$ of $[0 ldots pi)$, it might be computationally faster since the magnitude of the vectors is never calculated (avoiding two sqrt()) calls.







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Jan 15 at 19:48









            ja72ja72

            7,47212044




            7,47212044








            • 1




              $begingroup$
              So your method saves some two milliseconds in a calculation that used to take five milliseconds? (assuming that your assertion holds up, which is certainly not guaranteed.) Sounds like a useful method, if you're going to be doing this tens of thousands of times in your calculation - which is not the case for OP.
              $endgroup$
              – E.P.
              Jan 15 at 20:34










            • $begingroup$
              @EmilioPisanty - There is also the reason that when the vectors are really small near zero the division with the magnitude is unstable. The atan2() function is far more robust for the edge cases.
              $endgroup$
              – ja72
              Jan 15 at 21:18






            • 1




              $begingroup$
              All of that is completely moot. There's no hint of numerical analysis in the question.
              $endgroup$
              – E.P.
              Jan 15 at 22:19














            • 1




              $begingroup$
              So your method saves some two milliseconds in a calculation that used to take five milliseconds? (assuming that your assertion holds up, which is certainly not guaranteed.) Sounds like a useful method, if you're going to be doing this tens of thousands of times in your calculation - which is not the case for OP.
              $endgroup$
              – E.P.
              Jan 15 at 20:34










            • $begingroup$
              @EmilioPisanty - There is also the reason that when the vectors are really small near zero the division with the magnitude is unstable. The atan2() function is far more robust for the edge cases.
              $endgroup$
              – ja72
              Jan 15 at 21:18






            • 1




              $begingroup$
              All of that is completely moot. There's no hint of numerical analysis in the question.
              $endgroup$
              – E.P.
              Jan 15 at 22:19








            1




            1




            $begingroup$
            So your method saves some two milliseconds in a calculation that used to take five milliseconds? (assuming that your assertion holds up, which is certainly not guaranteed.) Sounds like a useful method, if you're going to be doing this tens of thousands of times in your calculation - which is not the case for OP.
            $endgroup$
            – E.P.
            Jan 15 at 20:34




            $begingroup$
            So your method saves some two milliseconds in a calculation that used to take five milliseconds? (assuming that your assertion holds up, which is certainly not guaranteed.) Sounds like a useful method, if you're going to be doing this tens of thousands of times in your calculation - which is not the case for OP.
            $endgroup$
            – E.P.
            Jan 15 at 20:34












            $begingroup$
            @EmilioPisanty - There is also the reason that when the vectors are really small near zero the division with the magnitude is unstable. The atan2() function is far more robust for the edge cases.
            $endgroup$
            – ja72
            Jan 15 at 21:18




            $begingroup$
            @EmilioPisanty - There is also the reason that when the vectors are really small near zero the division with the magnitude is unstable. The atan2() function is far more robust for the edge cases.
            $endgroup$
            – ja72
            Jan 15 at 21:18




            1




            1




            $begingroup$
            All of that is completely moot. There's no hint of numerical analysis in the question.
            $endgroup$
            – E.P.
            Jan 15 at 22:19




            $begingroup$
            All of that is completely moot. There's no hint of numerical analysis in the question.
            $endgroup$
            – E.P.
            Jan 15 at 22:19


















            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%2f3075541%2fcan-t-we-use-vector-product-to-find-the-angle-between-two-vectors%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Mario Kart Wii

            The Binding of Isaac: Rebirth/Afterbirth

            What does “Dominus providebit” mean?