Rotating a Cube Using Quaternions

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

A quaternion can represent both a rotation axis and the angle of rotation about this axis (a vector and a scalar). Instead of turning an object through a series of successive rotations with rotation matrices, quaternions are used to rotate an object more smoothly around an arbitrary axis (here ) and at any angle. This program uses the quaternion rotation formula: with (a pure quaternion), , and for a unit quaternion , such that if , . A derivation of these formulas is given in [1].

Contributed by: Gerard Balmens (February 2016)
Open content licensed under CC BY-NC-SA




[1] Wikipedia. "Quaternions and Spatial Rotation." (Feb 9, 2016) _rotation.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.