# QVM: Quaternions, Vectors, Matrices

### boost/qvm/quat_operations.hpp

This header defines all available function overloads that operate on quaternion objects.

### Synopsis:

#include <boost/qvm/quat_operations.hpp>

    namespace boost
    {
        namespace qvm
        {
            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            A & assign( A & a, B const & b );

            //Only enabled if:
            //  is_quat<R>::value && is_quat<A>::value
            template <class R,class A>
            R convert_to( A const & a );

            //Only enabled if:
            //  is_quat<R>::value && is_mat<A>::value &&
            //  mat_traits<A>::rows==3 && mat_traits<A>::cols==3
            template <class R,class A>
            R convert_to( A const & m );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            A & operator-=( A & a, B const & b );

            //Only enabled if: is_quat<A>::value
            template <class A>
            typename deduce_quat<A>::type
            operator-( A const & a );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value &&
            template <class A,class B>
            typename deduce_quat2<A,B>::type
            operator-( A const & a, B const & b );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            A & operator+=( A & a, B const & b );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value &&
            template <class A,class B>
            typename deduce_quat2<A,B>::type
            operator+( A const & a, B const & b );

            //Only enabled if: is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            A & operator/=( A & a, B b );

            //Only enabled if: is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            typename deduce_quat<A>::type
            operator/( A const & a, B b );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            A & operator*=( A & a, B const & b );

            //Only enabled if: is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            A & operator*=( A & a, B b );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            typename deduce_quat2<A,B>::type
            operator*( A const & a, B const & b );

            //Only enabled if: is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            typename deduce_quat<A>::type
            operator*( A const & a, B b );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            bool operator==( A const & a, B const & b );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            bool operator!=( A const & a, B const & b );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value
            template <class A,class B,class Cmp>
            bool cmp( A const & a, B const & b, Cmp pred );

            //Only enabled if: is_quat<A>::value
            template <class A>
            typename quat_traits<A>::scalar_type
            mag_sqr( A const & a );

            //Only enabled if: is_quat<A>::value
            template <class A>
            typename quat_traits<A>::scalar_type
            mag( A const & a );

            //Only enabled if: is_quat<A>::value
            template <class A>
            typename deduce_quat<A>::type
            normalized( A const & a );

            //Only enabled if: is_quat<A>::value
            template <class A>
            void normalize( A & a );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value
            template <class A,class B>
            typename deduce_scalar<A,B>::type
            dot( A const & a, B const & b );

            //Only enabled if: is_quat<A>::value
            template <class A>
            typename deduce_quat<A>::type
            conjugate( A const & a );

            //Only enabled if: is_quat<A>::value
            template <class A>
            typename deduce_quat<A>::type
            inverse( A const & a );

            //Only enabled if:
            //  is_quat<A>::value && is_quat<B>::value && is_scalar<C>
            template <class A,class B,class C>
            typename deduce_quat2<A,B> >::type
            slerp( A const & a, B const & b, C c );

            template <class T>
            -unspecified-return-type- zero_quat();

            //Only enabled if: is_quat<A>::value
            template <class A>
            void set_zero( A & a );

            template <class S>
            -unspecified-return-type- identity_quat();

            //Only enabled if: is_quat<A>::value
            template <class A>
            void set_identity( A & a );

            //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 );

            //Only enabled if:
            //  is_quat<A>::value &&
            //  is_vec<B>::value && vec_traits<B>::dim==3
            template <class A>
            void set_rot( A & a, B const & axis, typename vec_traits<B>::scalar_type angle );

            //Only enabled if:
            //  is_quat<A>::value &&
            //  is_vec<B>::value && vec_traits<B>::dim==3
            template <class A,class B>
            void rotate( A & a, B const & axis, typename quat_traits<A>::scalar_type angle );

            template <class Angle>
            -unspecified-return-type- rotx_quat( Angle const & angle );

            //Only enabled if: is_quat<A>::value
            template <class A>
            void set_rotx( A & a, typename quat_traits<A>::scalar_type angle );

            //Only enabled if: is_quat<A>::value
            template <class A>
            void rotate_x( A & a, typename quat_traits<A>::scalar_type angle );

            template <class Angle>
            -unspecified-return-type- roty_quat( Angle const & angle );

            //Only enabled if: is_quat<A>::value
            template <class A>
            void set_rotz( A & a, typename quat_traits<A>::scalar_type angle );

            //Only enabled if: is_quat<A>::value
            template <class A>
            void rotate_y( A & a, typename quat_traits<A>::scalar_type angle );

            template <class Angle>
            -unspecified-return-type- rotz_quat( Angle const & angle );

            //Only enabled if: is_quat<A>::value
            template <class A>
            void set_rotz( A & a, typename quat_traits<A>::scalar_type angle );

            //Only enabled if: is_quat<A>::value
            template <class A>
            void rotate_z( A & a, typename quat_traits<A>::scalar_type angle );

            //Only enabled if: is_quat<A>::value
            template <class Scalar,class A>
            -unspecified-return_type- scalar_cast( A const & a );

            //Only enabled if: is_quat<A>::value
            template <class A>
            -unspecified-return-type- qref( A & a );
        }
    }

See also: assign(quat,quat) | boost/qvm/operations.hpp | cmp(quat,quat) | conjugate | convert_to(quat) | dot(quat,quat) | identity_quat | inverse(quat) | mag(quat) | mag_sqr(quat) | normalize(quat) | normalized(quat) | operator!=(quat,quat) | operator*(quat,quat) | operator*(quat,scalar) | operator*=(quat,quat) | operator*=(quat,scalar) | operator+(quat,quat) | operator+=(quat,quat) | operator-(quat) | operator-(quat,quat) | operator-=(quat,quat) | operator/(quat,scalar) | operator/=(quat,scalar) | operator==(quat,quat) | qref | rot_quat | rotate(quat,vec,scalar) | rotate_x(quat,scalar) | rotate_y(quat,scalar) | rotate_z(quat,scalar) | rotx_quat(scalar) | roty_quat(scalar) | rotz_quat(scalar) | scalar_cast(quat) | set_identity(quat) | set_rot(quat,vec,scalar) | set_rotx(quat,scalar) | set_roty(quat,scalar) | set_rotz(quat,scalar) | set_zero(quat) | slerp | zero_quat