Say we have the transformation:

\begin{bmatrix} 1 & 0 & 0\\ 0 & 0 & 1\\ 0 & 1 & 0\\ \end{bmatrix}

i.e. the matrix that encodes swapping the z and y axes. This is equivalent to a reflection around the z=y line.

Is it possible to encode this same transformation in a quaternion?

  • $\begingroup$ The short answer is: yes. Search for "Quaternion to Matrix" and "Matrix to Quaternion" to get code examples. $\endgroup$
    – pmw1234
    Nov 30, 2022 at 22:25
  • $\begingroup$ All the vectors in the matrix must be unit length though. But the example you gave they are. $\endgroup$
    – pmw1234
    Dec 1, 2022 at 11:29

1 Answer 1


No; quaternions can only represent proper rotations (i.e. without reflection).

If you use non-unit quaternions, you can represent a combination of rotation and uniform scaling, but still not reflection.

  • $\begingroup$ euclideanspace.com/maths/geometry/affine/reflection/quaternion/… the math is slightly different for reflections $\endgroup$
    – pmw1234
    Dec 1, 2022 at 22:37
  • $\begingroup$ It's a non-standard application of quaternions. If you want to change the math, then you can do whatever you want of course. You can represent arbitrary reflections as a scale of (-1, 1, 1) followed by a quaternion rotation, too. $\endgroup$ Dec 2, 2022 at 0:35
  • $\begingroup$ This isn't inventing new math, and it certainly isn't changing the rules. And this little "trick" can be very handy. $\endgroup$
    – pmw1234
    Dec 2, 2022 at 10:34
  • $\begingroup$ @pmw1234 it says you can't use them for reflections and rotations simultaneously. $\endgroup$
    – user253751
    Dec 6, 2022 at 3:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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