muu/quaternion.h file

Contains the definition of muu::quaternion.

Namespaces

namespace muu
The root namespace for all muu functions and types.

Classes

template <typename Scalar>
struct muu::quaternion
A quaternion.
template <typename Scalar>
struct std::tuple_size<muu::quaternion<Scalar>>
Specialization of std::tuple_size for muu::quaternion.
template <size_t I, typename Scalar>
struct std::tuple_element<I, muu::quaternion<Scalar>>
Specialization of std::tuple_element for muu::quaternion.
template <typename Scalar>
struct muu::constants<quaternion<Scalar>>
Quaternion constants.

Functions

template <typename S, typename T>
auto approx_equal(const quaternion<S>& q1, const quaternion<T>& q2, epsilon_type<S, T> epsilon = default_epsilon<S, T>) -> bool constexpr noexcept
Returns true if two quaternions are approximately equal.
template <typename S>
auto approx_zero(const quaternion<S>& q, S epsilon = default_epsilon<S>) -> bool constexpr noexcept
Returns true if all the scalar components of a quaternion are approximately equal to zero.
template <typename S>
auto dot(const quaternion<S>& q1, const quaternion<S>& q2) -> S constexpr noexcept
Returns the dot product of two quaternions.
template <typename S>
auto infinity_or_nan(const quaternion<S>& q) -> bool constexpr noexcept
Returns true if any of the scalar components of a quaternion are infinity or NaN.
template <typename S>
auto normalize(const quaternion<S>& q) -> quaternion<S> constexpr noexcept
Normalizes a quaternion.
template <typename S>
auto normalized(const quaternion<S>& q) -> bool constexpr noexcept
Returns true if a quaternion is normalized (i.e. has a length of 1).
template <typename S>
auto slerp(const quaternion<S>& start, const quaternion<S>& finish, S alpha) -> quaternion<S> constexpr noexcept
Performs a spherical-linear interpolation between two quaternions.