Boost QVM

Accessing Quaternion Elements

#include <boost/qvm/q_access.hpp>

namespace boost
{
    namespace qvm
    {
        -unspecified-return-type- V();
        -unspecified-return-type- S();
    }
}

An expression of the form of q%V can be used to access the vector component of the quaternion q. For example,

q%V *= 42

can be used to multiply the vector component of q by the scalar 42.

An expression of the form of q%S can be used to access the scalar component of the quaternion q. For example,

q%S *= 42;

can be used to multiply the scalar component of q by the scalar 42.