title: Why are these 2 rotation matrices representing Quternions and Euler Angles not the same?
body: <p>The following is the representation for rotating about a unit quaternion {q0,q1,q2,q3} by an angle alpha:</p>
  
  <pre><code>q_0=cos(alpha/2)
  q_1=sin(alpha/2)cos(beta_x)
  q_2=sin(alpha/2)cos(beta_y)
  q_3=sin(alpha/2)cos(beta_z)
  </code></pre>
  
  <p>Here,beta_x, beta_y and beta_z are the direction cosines of the unit quaternion, i.e. the axis about which I am rotating. </p>
  
  <p>The rotation matrix corresponding to this is as follows: Let's call this <strong>R1</strong> </p>
  
  <pre><code> 1- 2(q_2^2 + q_3^2)   2(q_1 q_2 - q_0 q_3)    2(q_0 q_2 + q_1 q_3) 
  2(q_1 q_2 + q_0 q_3)   1 - 2(q_1^2 + q_3^2)    2(q_2 q_3 - q_0 q_1) 
  2(q_1 q_3 - q_0 q_2)   2( q_0 q_1 + q_2 q_3)   1 - 2(q_1^2 + q_2^2)
  </code></pre>
  
  <p>Now, suppose my rotation matrix is represented by using Euler angles instead: Let's call this <strong>R2</strong></p>
  
  <p><img src="https://i.stack.imgur.com/GuGTs.png" alt="enter image description here"></p>
  
  <p>R2 rotates a vector by phi around x axis first, then by theta around the y axis and finally by psi around the z axis. Now, suppose my axis of rotation is in the y-z plane.This means that there is no rotation around the x-axis, only a combination of rotations around the y and z axes. <strong>This means that phi is zero</strong>, which means that <strong>R2(3,2) is zero.</strong></p>
  
  <p>Alternatively, this also means that cos(beta_x) is zero, since there is no rotation about the x-axis.This means that q_1 is zero.<strong>However, if we look at R1(3,2), it is not zero, unlike R2(3,2).Why are these two representations not the same? What am I missing?</strong></p>