title: Quaternion to Rotation Matrix, incorrect values using Eigen Library
body: <p>I am trying to rotate an object by 45 degrees using quaternions about Y-Axis.
  After Specifying the Quaternion i am trying to get the Rotation Matrix. But the values I see are incorrect</p>
  
  <pre><code>Eigen::Quaterniond q;
  q.x() = 0;
  q.y() = 1;
  q.z() = 0;
  q.w() = PI/8;    // Half of the rotation angle must be specified, even IDK why
  
  Eigen::Matrix3d R = q.normalized().toRotationMatrix();
  std::cout &lt;&lt; "R=" &lt;&lt; std::endl &lt;&lt; R &lt;&lt; std::endl;
  </code></pre>
  
  <p><strong>OUTPUT :</strong></p>
  
  <pre><code>R=
  -0.732    -0   -0.680
       0     1       -0
   0.680     0   -0.732
  </code></pre>
  
  <p><br>
  Since the OpenGL Rotation Matrix along Y-Axis should be : </p>
  
  <p><a href="https://i.stack.imgur.com/9JOdE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9JOdE.png" alt="enter image description here"></a></p>
  
  <p>Therefore my expected output should be :</p>
  
  <pre><code>R=
   0.707     0    0.707
       0     1        0
  -0.707     0    0.707
  </code></pre>
  
  <p>Not only are the values off by a small percent the wrong signs on the values are causing some unexpected rotations. Because of the negative signs my cube is doing a 180 degree turn plus the specified angle. I have broken my head over this for the whole day. Can some one tell me what I am doing wrong ?</p>