title: Euler angle to Quaternion then Quaternion to euler angle
body: <p>I'm using lib glm (<a href="http://glm.g-truc.net/" rel="noreferrer">http://glm.g-truc.net/</a>) for test quaternion but I've a problem; when I convert euler angle to quaternion then immediatly quaternion to euler angles, my result are totally different from my initial euler angles. Is this normal? Could it be because the rotations are not communative?</p>
  
  <p>Code test:</p>
  
  <pre><code>#include &lt;glm\quaternion.hpp&gt;
  #include &lt;math.h&gt;
  
  #define PI M_PI
  #define RADTODEG(x) ( (x) * 180.0 / PI )
  #define DEGTORAD(x) ( (x) * PI / 180.0 )
  
  int         main( void )
  {
      float RotX = 90.f;
      float RotY = 180.f;
      float RotZ = -270.f;
  
      if ( RotX || RotY || RotZ )
      {
          std::cout &lt;&lt; "Init: x= " &lt;&lt; RotX &lt;&lt; ", y= " &lt;&lt; RotY &lt;&lt; ", z= " &lt;&lt; RotZ &lt;&lt; "\n";
          glm::quat key_quat(glm::detail::tvec3&lt;float&gt;(DEGTORAD( RotX ),
                                                       DEGTORAD( RotY ),
                                                       DEGTORAD( RotZ )));
          glm::detail::tvec3&lt;float&gt; v = glm::eulerAngles(key_quat);
  
          /*  // the result is even worse with this code here
          RotX = RADTODEG(v.x);
          RotY = RADTODEG(v.y);
          RotZ = RADTODEG(v.z);
          */
  
          RotX = v.x;
          RotY = v.y;
          RotZ = v.z;
  
          std::cout &lt;&lt; "Final: x= " &lt;&lt; RotX &lt;&lt; ", y= " &lt;&lt; RotY &lt;&lt; ", z= " &lt;&lt; RotZ &lt;&lt; "\n";
      }
      return (0);
  }
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>Init: x= 90, y= 180, z= -270
  Final: x= -90, y= -3.41509e-006, z= -90
  </code></pre>
  
  <p>thank you in advance o/</p>