On the Wolfram|Alpha website, I type quaternion(1,1,1,1) into the search field. Wolfram|Alpha shows a 3D transformation of the quaternion values representing the orientation of an object.

I have 9 more quaternion values other than quaternion(1,1,1,1).

I would like to ask how can I visualize the 3D transformation of the remaining 9 quaternion values, but without using the Wolfram|Alpha website and opening 9 more tabs and keying in the additional values into search fields.

I hope, rather, to write a Mathematica program to demonstrate rotation according to my 10 quaternion values. Every rotation will take 1 second, so in total the demonstration will take 10 seconds for all 10 rotations.

Can anyone help me how I can write the code for my proposed demonstration?

  • 1
    $\begingroup$ Do you want to do this with Wolfram|Alpha, the website, or with Mathematica, the desktop software? $\endgroup$
    – Szabolcs
    Aug 2, 2015 at 11:20
  • $\begingroup$ if can, using mathematica. $\endgroup$ Aug 2, 2015 at 11:29
  • $\begingroup$ You can convert the quaternion to a rotation matrix, then use GeometricTransformation and AffineTransform. $\endgroup$
    – Szabolcs
    Aug 2, 2015 at 11:41
  • $\begingroup$ Maybe you can help me. I have quartenion code here. demonstrations.wolfram.com/… $\endgroup$ Aug 2, 2015 at 12:14
  • $\begingroup$ This may be helpful: mathematica.stackexchange.com/a/51487/1997 $\endgroup$
    – ubpdqn
    Aug 2, 2015 at 23:26

1 Answer 1


Kind of a part answer: It is quite easy to convert a quaternion to a Mathematica RotationMatrix. First normalize the quaternion. The first element will then be the cosine of half the rotation angle. The last 3 elements together describes the axis of rotation.

q = Normalize@{1, 1, 1, 1}
rm = RotationMatrix[2 ArcCos[First@q], Rest@q]

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