CwMtx is a library written in C++ that provides the matrix and vector operations that are used extensively in engineering and science problems. A special feature of this library is the quaternion class which implements quaternion math. Quaternions are very useful for attitude determination in 3D space because they do not suffer from singularities. Furthermore, successive rotations and transformations of vectors can be accomplished by simple quaternion multiplication. Attitude dynamics can be expressed in a very compact form using quaternions (Source: