Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

QVM: Quaternions, Vectors, Matrices

rot_quat

#include <boost/qvm/quat_operations.hpp>

namespace qvm
{
    //Only enabled if:
    //  is_vec<A>::value && vec_traits<A>::dim==3
    template <class A>
    -unspecified-return-type- rot_quat( A const & axis, typename vec_traits<A>::scalar_type angle );
}

Returns:

A quaternion of unspecified type which performs a rotation around the axis at angle radians.

Throws:

In case the axis vector has zero magnitude, throws zero_magnitude_error.

Note:

The rot_quat function is not a view proxy; it returns a temp object.