A bit confused on Quaternion












1














Sorry for noobish question.



I am trying to make use of quaternion in my work.



I get input which has 2 parts:



Corners of a square polygon, and a quaternion which encodes rotation of this polygon in 3D space.
I read about Quaternion, and understand that it has 4 components(h,a,b,c).



h is Cos(ang/2) where ang is angle of rotation.



a = v1*Sin(ang/2)



b = v2*Sin(ang/2)



c = v3*Sin(ang/2)



Here, v1,v2,v3 are components of unit vector along rotation axis.



So given a quaternion(h,a,b,c), we can find find ang and v1,v2,v3.



My query is that a unit vector(v1,v2,v3) doesn't uniquely represent a vector as all parallel vectors have same unit vector.



So how can we uniquely find axis of rotation? Or do I need to use centre of polygon to do that?










share|cite|improve this question





























    1














    Sorry for noobish question.



    I am trying to make use of quaternion in my work.



    I get input which has 2 parts:



    Corners of a square polygon, and a quaternion which encodes rotation of this polygon in 3D space.
    I read about Quaternion, and understand that it has 4 components(h,a,b,c).



    h is Cos(ang/2) where ang is angle of rotation.



    a = v1*Sin(ang/2)



    b = v2*Sin(ang/2)



    c = v3*Sin(ang/2)



    Here, v1,v2,v3 are components of unit vector along rotation axis.



    So given a quaternion(h,a,b,c), we can find find ang and v1,v2,v3.



    My query is that a unit vector(v1,v2,v3) doesn't uniquely represent a vector as all parallel vectors have same unit vector.



    So how can we uniquely find axis of rotation? Or do I need to use centre of polygon to do that?










    share|cite|improve this question



























      1












      1








      1







      Sorry for noobish question.



      I am trying to make use of quaternion in my work.



      I get input which has 2 parts:



      Corners of a square polygon, and a quaternion which encodes rotation of this polygon in 3D space.
      I read about Quaternion, and understand that it has 4 components(h,a,b,c).



      h is Cos(ang/2) where ang is angle of rotation.



      a = v1*Sin(ang/2)



      b = v2*Sin(ang/2)



      c = v3*Sin(ang/2)



      Here, v1,v2,v3 are components of unit vector along rotation axis.



      So given a quaternion(h,a,b,c), we can find find ang and v1,v2,v3.



      My query is that a unit vector(v1,v2,v3) doesn't uniquely represent a vector as all parallel vectors have same unit vector.



      So how can we uniquely find axis of rotation? Or do I need to use centre of polygon to do that?










      share|cite|improve this question















      Sorry for noobish question.



      I am trying to make use of quaternion in my work.



      I get input which has 2 parts:



      Corners of a square polygon, and a quaternion which encodes rotation of this polygon in 3D space.
      I read about Quaternion, and understand that it has 4 components(h,a,b,c).



      h is Cos(ang/2) where ang is angle of rotation.



      a = v1*Sin(ang/2)



      b = v2*Sin(ang/2)



      c = v3*Sin(ang/2)



      Here, v1,v2,v3 are components of unit vector along rotation axis.



      So given a quaternion(h,a,b,c), we can find find ang and v1,v2,v3.



      My query is that a unit vector(v1,v2,v3) doesn't uniquely represent a vector as all parallel vectors have same unit vector.



      So how can we uniquely find axis of rotation? Or do I need to use centre of polygon to do that?







      quaternions






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Nov 20 '18 at 3:00

























      asked Nov 20 '18 at 2:36









      Mapper

      83




      83






















          2 Answers
          2






          active

          oldest

          votes


















          1














          In order to fully describe the rotation, you must have not only the direction of the axis but you must also identify some point that the axis passes through.



          In many applications where the points of 3D space are assigned Cartesian coordinates $(x,y,z),$ it is conventional to assume that every rotation axis passes through the point $(0,0,0).$



          You can specify an axis that does not pass through $(0,0,0),$ but typically the way to manage that is to specify some point on that axis,
          translate the entire space so that that point is translated to $(0,0,0),$
          perform the rotation, then reverse the translation.



          If you have an axis through the point $(0,0,0)$ and a vector parallel to that axis, all other vectors parallel to this vector also specify the same axis.
          There is no other axis through $(0,0,0)$ parallel to any of those vectors.



          The vectors parallel to the given axis also include vectors pointing in the opposite direction, but it is also conventional that the direction in which you rotate the object depends on the sign of the rotation angle and the direction of the vector that identifies the axis. You can reverse the vector and still rotate around the same axis, but to get the same rotation you must then also reverse the angle.



          The quaternion representation is not unique, by the way. The quaternions $(h,a,b,c)$ and $(-h,-a,-b,-c)$ are different but represent the same rotation.






          share|cite|improve this answer





























            2














            Rotations of three space are a group called $SO(3)$. They are three by three matrices $A$ of determinant $1$ so that $AA^t=Id$. Euler's theorem says that a rotation matrix always has $1$ as an eigenvalue, the line spanned by the eigenvector is the ``axis of rotation''. Notice a line through the origin always intersects the unit sphere in two points. Hence the normalized axis of rotation is ambiguous.



            Recall, that if $q=a+x{bf i} +y{bf j}+z{bf k}$ then $overline{q}=a-x{bf i} -y{bf j}-z{bf k}$. We say $overline{q}$ is the complex conjugate of $q$. Also $Re(q)=a$ and $Im(q)=x{bf i} +y{bf j}+z{bf k}$. The ``dot product'' in $mathbb{R}^4$ is given by $$pcdot q=Re(poverline{q}).$$ There is an embedding $I:mathbb{R}^3rightarrow mathbb{R}^4$ given by $$I(x{bf i} +y{bf j}+z{bf k})=0+x{bf i} +y{bf j}+z{bf k}.$$ That is we can see $mathbb{R}^3$ as the {em purely imaginary} quaternions.



            The unit quaternions $qin mathbb{R}^4$ are the quaternions so that $qoverline{q}=1$. The unit quaterions form a group, sometimes called $Spin(3)$ or other times called $SU(2)$. There is a map
            $C:SU(2)rightarrow SO(3)$ which is given by the action you describe in your question. The way to understand $C$ is as ``conjugation}. The formula for $C$ is
            $$ C(q)vec{v}=I^{-1}(qI(vec{v})overline{q} ).$$ That is map the vector into $mathbb{R}^4$ as a purely imaginary quaternion, conjugate by $q$ and then take its inverse image under $I$. Check that if you conjugate a purely imaginary quaternion by a quaternion, the output is purely imaginary, so the formula makes sense.



            Notice that $C(q)=C(-q)$ because the minus sign appears twice in the formula. You can check that the map $C$ is $2$-to-$1$. The inverse image of any rotation $A$ is two quaternions ${q,-q}$.



            Hence the ambiguity in the imaginary part.






            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%2f3005857%2fa-bit-confused-on-quaternion%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














              In order to fully describe the rotation, you must have not only the direction of the axis but you must also identify some point that the axis passes through.



              In many applications where the points of 3D space are assigned Cartesian coordinates $(x,y,z),$ it is conventional to assume that every rotation axis passes through the point $(0,0,0).$



              You can specify an axis that does not pass through $(0,0,0),$ but typically the way to manage that is to specify some point on that axis,
              translate the entire space so that that point is translated to $(0,0,0),$
              perform the rotation, then reverse the translation.



              If you have an axis through the point $(0,0,0)$ and a vector parallel to that axis, all other vectors parallel to this vector also specify the same axis.
              There is no other axis through $(0,0,0)$ parallel to any of those vectors.



              The vectors parallel to the given axis also include vectors pointing in the opposite direction, but it is also conventional that the direction in which you rotate the object depends on the sign of the rotation angle and the direction of the vector that identifies the axis. You can reverse the vector and still rotate around the same axis, but to get the same rotation you must then also reverse the angle.



              The quaternion representation is not unique, by the way. The quaternions $(h,a,b,c)$ and $(-h,-a,-b,-c)$ are different but represent the same rotation.






              share|cite|improve this answer


























                1














                In order to fully describe the rotation, you must have not only the direction of the axis but you must also identify some point that the axis passes through.



                In many applications where the points of 3D space are assigned Cartesian coordinates $(x,y,z),$ it is conventional to assume that every rotation axis passes through the point $(0,0,0).$



                You can specify an axis that does not pass through $(0,0,0),$ but typically the way to manage that is to specify some point on that axis,
                translate the entire space so that that point is translated to $(0,0,0),$
                perform the rotation, then reverse the translation.



                If you have an axis through the point $(0,0,0)$ and a vector parallel to that axis, all other vectors parallel to this vector also specify the same axis.
                There is no other axis through $(0,0,0)$ parallel to any of those vectors.



                The vectors parallel to the given axis also include vectors pointing in the opposite direction, but it is also conventional that the direction in which you rotate the object depends on the sign of the rotation angle and the direction of the vector that identifies the axis. You can reverse the vector and still rotate around the same axis, but to get the same rotation you must then also reverse the angle.



                The quaternion representation is not unique, by the way. The quaternions $(h,a,b,c)$ and $(-h,-a,-b,-c)$ are different but represent the same rotation.






                share|cite|improve this answer
























                  1












                  1








                  1






                  In order to fully describe the rotation, you must have not only the direction of the axis but you must also identify some point that the axis passes through.



                  In many applications where the points of 3D space are assigned Cartesian coordinates $(x,y,z),$ it is conventional to assume that every rotation axis passes through the point $(0,0,0).$



                  You can specify an axis that does not pass through $(0,0,0),$ but typically the way to manage that is to specify some point on that axis,
                  translate the entire space so that that point is translated to $(0,0,0),$
                  perform the rotation, then reverse the translation.



                  If you have an axis through the point $(0,0,0)$ and a vector parallel to that axis, all other vectors parallel to this vector also specify the same axis.
                  There is no other axis through $(0,0,0)$ parallel to any of those vectors.



                  The vectors parallel to the given axis also include vectors pointing in the opposite direction, but it is also conventional that the direction in which you rotate the object depends on the sign of the rotation angle and the direction of the vector that identifies the axis. You can reverse the vector and still rotate around the same axis, but to get the same rotation you must then also reverse the angle.



                  The quaternion representation is not unique, by the way. The quaternions $(h,a,b,c)$ and $(-h,-a,-b,-c)$ are different but represent the same rotation.






                  share|cite|improve this answer












                  In order to fully describe the rotation, you must have not only the direction of the axis but you must also identify some point that the axis passes through.



                  In many applications where the points of 3D space are assigned Cartesian coordinates $(x,y,z),$ it is conventional to assume that every rotation axis passes through the point $(0,0,0).$



                  You can specify an axis that does not pass through $(0,0,0),$ but typically the way to manage that is to specify some point on that axis,
                  translate the entire space so that that point is translated to $(0,0,0),$
                  perform the rotation, then reverse the translation.



                  If you have an axis through the point $(0,0,0)$ and a vector parallel to that axis, all other vectors parallel to this vector also specify the same axis.
                  There is no other axis through $(0,0,0)$ parallel to any of those vectors.



                  The vectors parallel to the given axis also include vectors pointing in the opposite direction, but it is also conventional that the direction in which you rotate the object depends on the sign of the rotation angle and the direction of the vector that identifies the axis. You can reverse the vector and still rotate around the same axis, but to get the same rotation you must then also reverse the angle.



                  The quaternion representation is not unique, by the way. The quaternions $(h,a,b,c)$ and $(-h,-a,-b,-c)$ are different but represent the same rotation.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Nov 20 '18 at 14:28









                  David K

                  52.6k340115




                  52.6k340115























                      2














                      Rotations of three space are a group called $SO(3)$. They are three by three matrices $A$ of determinant $1$ so that $AA^t=Id$. Euler's theorem says that a rotation matrix always has $1$ as an eigenvalue, the line spanned by the eigenvector is the ``axis of rotation''. Notice a line through the origin always intersects the unit sphere in two points. Hence the normalized axis of rotation is ambiguous.



                      Recall, that if $q=a+x{bf i} +y{bf j}+z{bf k}$ then $overline{q}=a-x{bf i} -y{bf j}-z{bf k}$. We say $overline{q}$ is the complex conjugate of $q$. Also $Re(q)=a$ and $Im(q)=x{bf i} +y{bf j}+z{bf k}$. The ``dot product'' in $mathbb{R}^4$ is given by $$pcdot q=Re(poverline{q}).$$ There is an embedding $I:mathbb{R}^3rightarrow mathbb{R}^4$ given by $$I(x{bf i} +y{bf j}+z{bf k})=0+x{bf i} +y{bf j}+z{bf k}.$$ That is we can see $mathbb{R}^3$ as the {em purely imaginary} quaternions.



                      The unit quaternions $qin mathbb{R}^4$ are the quaternions so that $qoverline{q}=1$. The unit quaterions form a group, sometimes called $Spin(3)$ or other times called $SU(2)$. There is a map
                      $C:SU(2)rightarrow SO(3)$ which is given by the action you describe in your question. The way to understand $C$ is as ``conjugation}. The formula for $C$ is
                      $$ C(q)vec{v}=I^{-1}(qI(vec{v})overline{q} ).$$ That is map the vector into $mathbb{R}^4$ as a purely imaginary quaternion, conjugate by $q$ and then take its inverse image under $I$. Check that if you conjugate a purely imaginary quaternion by a quaternion, the output is purely imaginary, so the formula makes sense.



                      Notice that $C(q)=C(-q)$ because the minus sign appears twice in the formula. You can check that the map $C$ is $2$-to-$1$. The inverse image of any rotation $A$ is two quaternions ${q,-q}$.



                      Hence the ambiguity in the imaginary part.






                      share|cite|improve this answer




























                        2














                        Rotations of three space are a group called $SO(3)$. They are three by three matrices $A$ of determinant $1$ so that $AA^t=Id$. Euler's theorem says that a rotation matrix always has $1$ as an eigenvalue, the line spanned by the eigenvector is the ``axis of rotation''. Notice a line through the origin always intersects the unit sphere in two points. Hence the normalized axis of rotation is ambiguous.



                        Recall, that if $q=a+x{bf i} +y{bf j}+z{bf k}$ then $overline{q}=a-x{bf i} -y{bf j}-z{bf k}$. We say $overline{q}$ is the complex conjugate of $q$. Also $Re(q)=a$ and $Im(q)=x{bf i} +y{bf j}+z{bf k}$. The ``dot product'' in $mathbb{R}^4$ is given by $$pcdot q=Re(poverline{q}).$$ There is an embedding $I:mathbb{R}^3rightarrow mathbb{R}^4$ given by $$I(x{bf i} +y{bf j}+z{bf k})=0+x{bf i} +y{bf j}+z{bf k}.$$ That is we can see $mathbb{R}^3$ as the {em purely imaginary} quaternions.



                        The unit quaternions $qin mathbb{R}^4$ are the quaternions so that $qoverline{q}=1$. The unit quaterions form a group, sometimes called $Spin(3)$ or other times called $SU(2)$. There is a map
                        $C:SU(2)rightarrow SO(3)$ which is given by the action you describe in your question. The way to understand $C$ is as ``conjugation}. The formula for $C$ is
                        $$ C(q)vec{v}=I^{-1}(qI(vec{v})overline{q} ).$$ That is map the vector into $mathbb{R}^4$ as a purely imaginary quaternion, conjugate by $q$ and then take its inverse image under $I$. Check that if you conjugate a purely imaginary quaternion by a quaternion, the output is purely imaginary, so the formula makes sense.



                        Notice that $C(q)=C(-q)$ because the minus sign appears twice in the formula. You can check that the map $C$ is $2$-to-$1$. The inverse image of any rotation $A$ is two quaternions ${q,-q}$.



                        Hence the ambiguity in the imaginary part.






                        share|cite|improve this answer


























                          2












                          2








                          2






                          Rotations of three space are a group called $SO(3)$. They are three by three matrices $A$ of determinant $1$ so that $AA^t=Id$. Euler's theorem says that a rotation matrix always has $1$ as an eigenvalue, the line spanned by the eigenvector is the ``axis of rotation''. Notice a line through the origin always intersects the unit sphere in two points. Hence the normalized axis of rotation is ambiguous.



                          Recall, that if $q=a+x{bf i} +y{bf j}+z{bf k}$ then $overline{q}=a-x{bf i} -y{bf j}-z{bf k}$. We say $overline{q}$ is the complex conjugate of $q$. Also $Re(q)=a$ and $Im(q)=x{bf i} +y{bf j}+z{bf k}$. The ``dot product'' in $mathbb{R}^4$ is given by $$pcdot q=Re(poverline{q}).$$ There is an embedding $I:mathbb{R}^3rightarrow mathbb{R}^4$ given by $$I(x{bf i} +y{bf j}+z{bf k})=0+x{bf i} +y{bf j}+z{bf k}.$$ That is we can see $mathbb{R}^3$ as the {em purely imaginary} quaternions.



                          The unit quaternions $qin mathbb{R}^4$ are the quaternions so that $qoverline{q}=1$. The unit quaterions form a group, sometimes called $Spin(3)$ or other times called $SU(2)$. There is a map
                          $C:SU(2)rightarrow SO(3)$ which is given by the action you describe in your question. The way to understand $C$ is as ``conjugation}. The formula for $C$ is
                          $$ C(q)vec{v}=I^{-1}(qI(vec{v})overline{q} ).$$ That is map the vector into $mathbb{R}^4$ as a purely imaginary quaternion, conjugate by $q$ and then take its inverse image under $I$. Check that if you conjugate a purely imaginary quaternion by a quaternion, the output is purely imaginary, so the formula makes sense.



                          Notice that $C(q)=C(-q)$ because the minus sign appears twice in the formula. You can check that the map $C$ is $2$-to-$1$. The inverse image of any rotation $A$ is two quaternions ${q,-q}$.



                          Hence the ambiguity in the imaginary part.






                          share|cite|improve this answer














                          Rotations of three space are a group called $SO(3)$. They are three by three matrices $A$ of determinant $1$ so that $AA^t=Id$. Euler's theorem says that a rotation matrix always has $1$ as an eigenvalue, the line spanned by the eigenvector is the ``axis of rotation''. Notice a line through the origin always intersects the unit sphere in two points. Hence the normalized axis of rotation is ambiguous.



                          Recall, that if $q=a+x{bf i} +y{bf j}+z{bf k}$ then $overline{q}=a-x{bf i} -y{bf j}-z{bf k}$. We say $overline{q}$ is the complex conjugate of $q$. Also $Re(q)=a$ and $Im(q)=x{bf i} +y{bf j}+z{bf k}$. The ``dot product'' in $mathbb{R}^4$ is given by $$pcdot q=Re(poverline{q}).$$ There is an embedding $I:mathbb{R}^3rightarrow mathbb{R}^4$ given by $$I(x{bf i} +y{bf j}+z{bf k})=0+x{bf i} +y{bf j}+z{bf k}.$$ That is we can see $mathbb{R}^3$ as the {em purely imaginary} quaternions.



                          The unit quaternions $qin mathbb{R}^4$ are the quaternions so that $qoverline{q}=1$. The unit quaterions form a group, sometimes called $Spin(3)$ or other times called $SU(2)$. There is a map
                          $C:SU(2)rightarrow SO(3)$ which is given by the action you describe in your question. The way to understand $C$ is as ``conjugation}. The formula for $C$ is
                          $$ C(q)vec{v}=I^{-1}(qI(vec{v})overline{q} ).$$ That is map the vector into $mathbb{R}^4$ as a purely imaginary quaternion, conjugate by $q$ and then take its inverse image under $I$. Check that if you conjugate a purely imaginary quaternion by a quaternion, the output is purely imaginary, so the formula makes sense.



                          Notice that $C(q)=C(-q)$ because the minus sign appears twice in the formula. You can check that the map $C$ is $2$-to-$1$. The inverse image of any rotation $A$ is two quaternions ${q,-q}$.



                          Hence the ambiguity in the imaginary part.







                          share|cite|improve this answer














                          share|cite|improve this answer



                          share|cite|improve this answer








                          edited Nov 20 '18 at 12:47

























                          answered Nov 20 '18 at 12:35









                          Charlie Frohman

                          1,343812




                          1,343812






























                              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%2f3005857%2fa-bit-confused-on-quaternion%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

                              MongoDB - Not Authorized To Execute Command

                              How to fix TextFormField cause rebuild widget in Flutter

                              Npm cannot find a required file even through it is in the searched directory