title: Find angle from 3x3 matrix components
body: <p>I have a 3x3 rotation matrix:</p>
  
  <pre><code>[  cos( angle ) sin( angle ) 0 ]
  [ -sin( angle ) cos( angle ) 0 ]
  [  0            0            1 ]
  </code></pre>
  
  <p>How do I work out <code>angle</code>?</p>
  
  <p>The methods I'm using now to do this is:</p>
  
  <pre><code>void Mat3::SetAngle( const float angle ) {
      m[ 0 + 0 * 3 ] = cos( angle );
      m[ 1 + 0 * 3 ] = sin( angle );
      m[ 0 + 1 * 3 ] = -sin( angle );
      m[ 1 + 1 * 3 ] = cos( angle );
  }
  </code></pre>
  
  <p>And to retreive it I'm using:</p>
  
  <pre><code>float Mat3::GetAngle( void ) {
      return atan2( m[ 1 + 0 * 3], m[ 0 + 0 * 3] );
  }
  </code></pre>
  
  <p>I'm testing it like this:</p>
  
  <pre><code>Mat3 m;
  m.SetAngle( 179.0f );
  float a = m.GetAngle();
  </code></pre>
  
  <p>And a ends up being 3.0708115 which is not correct.</p>