Skip to main content

Module quaternion

Module quaternion 

Source
Expand description

Unit quaternions for rotation.

Preferred over matrices wherever rotations are composed or interpolated: repeated matrix products drift away from orthonormality and have to be re-orthonormalized, while a quaternion only needs renormalizing, and there is no meaningful way to interpolate two rotation matrices directly.

Quaternion is not constrained to unit length by construction (the arithmetic needs unnormalized intermediates), but every rotation operation either requires or restores unit length, and says which in its documentation.

Structsยง

Quaternion
A quaternion w + xi + yj + zk.