on matrix

 OUTPUTS 1,4,5,6,7
  R       - 3x3 rotation matrix

 OUTPUTS 2
  u       - axis of rotation
  theta   - angle of rotation (radians)

 OUTPUTS 3
  R       - 2x2 Rotation matrix

 OUTPUTS 8
  th1     - angle with respect to X axis
  th2     - angle with respect to Y axis
  th3     - angle with respect to Z axis
     such that R = Rx*Ry*Rz

 EXAMPLE 1
  R3 = rotationMatrix( [0 0 1], pi/4 )+rand(3)/50
  R3r = rotationMatrix( R3 )
  [u,theta]  = rotationMatrix( R3r )

 EXAMPLE 2