What is a quaternion? How do I use a quaternion?

By admin , 19 March 2026
Answer

A quaternion is a number with a real and three imaginary components, q = a + i b + j c + k d

A quaternion represents a rotational frame in a form related to the angle theta and axis v of rotation, where v is a three-dimensional unit (length 1) vector, and q = sin (theta / 2) + i * vx * cos(theta/2) + i * vy * cos(theta/2) + k * vz * cos(theta/2)

You can easily convert a quaternion to Euler angles or a rotation matrix.

http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

The DMP calculates the MotionFusion solution as a quaternion because it is the most efficient representation for mathematical applications.