Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I find two different rotation matrices are mapped to a single quaternion.

$$ \begin{pmatrix} -1 & 0 & 0 \\ 0 & \frac{\sqrt{2}}{2} & -\frac{\sqrt{2}}{2} \\ 0 & -\frac{\sqrt{2}}{2} & -\frac{\sqrt{2}}{2} \end{pmatrix} $$

$$ \begin{pmatrix} -1 & 0 & 0 \\ 0 & \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \\ 0 & \frac{\sqrt{2}}{2} & -\frac{\sqrt{2}}{2} \end{pmatrix} $$

They are both mapped to a quaternion:

$w: 0$

$x: 0$

$y: 0.9238795325112867$

$z: 0.38268343236508984$

Is it a problem relate to my matrix-quaternion conversion program?

share|cite|improve this question
up vote 2 down vote accepted

Yes, it's a problem. Both matrices describe rotations through $\pi$ and thus correspond to a quaternion with $w=0$ and $(x,y,z)$ a unit vector along the axis of rotation. The quaternion you give corresponds to the axis of rotation of the second rotation matrix, whereas the first one has the sign of the $y$ component flipped.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.