libmath-quaternion-perl

Perl routines to handle operations on quaternions
  https://metacpan.org/release/Math-Quaternion/
  0
  no reviews



Math::quaternion lets you create and manipulate quaternions. a quaternion is a mathematical object developed as a kind of generalization of complex numbers, usually represented by an array of four real numbers, and is often used to represent rotations in three-dimensional space.

see, for example, http://mathworld.wolfram.com/quaternion.html for more details on the mathematics of quaternions.

quaternions can be added, subtracted, and scaled just like complex numbers or vectors -- they can also be multiplied, but quaternion multiplication does not commute. that is to say, if you have quaternions $q1 and $q2, then in general $q1*$q2 != $q2*$q1. this is related to their use in representing rotations, which also do not commute.