mal-math
C++20 mathematics library.
All Classes Namespaces Files Functions Variables Typedefs Concepts
quaternion.inl File Reference
#include "quaternion.hpp"
Include dependency graph for quaternion.inl:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  mal_math
 Contains mathematical utility functions and classes.
 

Functions

template<Primitive T>
constexpr std::istream & mal_math::operator>> (std::istream &is, qua< T > &vec)
 
template<Primitive T>
constexpr std::ostream & mal_math::operator<< (std::ostream &os, qua< T > &vec)
 
template<Primitive T, Primitive U>
constexpr qua< T > mal_math::operator* (U const value, qua< T > const &vector) noexcept
 Scalar-quaternion multiplication.
 
template<Primitive T, Primitive U>
constexpr qua< T > mal_math::operator/ (U const value, qua< T > const &vector) noexcept
 Scalar-quaternion division.
 
template<Primitive T, Primitive U>
constexpr qua< T > mal_math::operator* (qua< T > const &vector, U const value) noexcept
 Quaternion-scalar multiplication.
 
template<Primitive T, Primitive U>
constexpr qua< T > mal_math::operator/ (qua< T > const &vector, U const value) noexcept
 Quaternion-scalar division.
 
template<Primitive T, Primitive U>
constexpr qua< T > mal_math::operator+ (qua< T > const &left, qua< U > const &right) noexcept
 Quaternion addition.
 
template<Primitive T, Primitive U>
constexpr qua< T > mal_math::operator- (qua< T > const &left, qua< U > const &right) noexcept
 Quaternion subtraction.
 
template<Primitive T, Primitive U>
constexpr qua< T > mal_math::operator* (qua< T > const &left, qua< U > const &right) noexcept
 Quaternion multiplication.
 
template<Primitive T, Primitive U>
constexpr qua< T > mal_math::operator/ (qua< T > const &left, qua< U > const &right) noexcept
 Quaternion division.
 
template<Primitive T, Primitive U>
constexpr T mal_math::dot (qua< T > const &left, qua< U > const &right) noexcept
 Computes the dot product of two quaternions.
 
template<Primitive T>
constexpr T mal_math::angle (qua< T > const &quaternion) noexcept
 Computes the angle (or magnitude) of a quaternion.
 
template<Primitive T>
constexpr T mal_math::pitch (qua< T > const &quaternion) noexcept
 Computes the pitch from a quaternion.
 
template<Primitive T>
constexpr T mal_math::yaw (qua< T > const &quaternion) noexcept
 Computes the yaw from a quaternion.
 
template<Primitive T>
constexpr T mal_math::roll (qua< T > const &quaternion) noexcept
 Computes the roll from a quaternion.
 
template<Primitive T>
constexpr vec< 3, T > mal_math::QuaternionToEuler (qua< T > const &quaternion) noexcept
 Converts a quaternion to Euler angles.
 
template<Primitive T>
qua< T > constexpr mal_math::conjugate (qua< T > const &q) noexcept
 Computes the conjugate of a quaternion.
 
template<Primitive T>
qua< T > constexpr mal_math::inverse (qua< T > const &q) noexcept
 Computes the inverse of a quaternion.
 
template<Primitive T, Primitive U>
constexpr vec< 3, T > mal_math::cross (qua< T > const &left, vec< 3, U > const &right) noexcept
 Cross product between quaternion and vector.
 
template<Primitive T, Primitive U>
constexpr vec< 3, T > mal_math::cross (vec< 3, U > const &left, qua< T > const &right) noexcept
 Cross product between vector and quaternion.
 
template<Primitive T, Primitive U>
constexpr qua< T > mal_math::cross (qua< T > const &left, qua< U > const &right) noexcept
 Computes the cross product of two quaternions.
 
template<Primitive T>
constexpr qua< T > mal_math::QuaternionFromEuler (vec< 3, T > const &angles) noexcept
 Creates a quaternion from Euler angles given in a vector.
 
template<Primitive T>
requires (std::is_floating_point_v<T>)
constexpr qua< T > mal_math::QuaternionFromEuler (T roll, T pitch, T yaw) noexcept
 Creates a quaternion from individual Euler angles.
 
template<AnyMat U>
requires (U::size.x == 3 && U::size.y == 3 && std::is_floating_point_v<typename U::type>)
constexpr qua< typename U::type > mal_math::QuaternionFromRotationMatrix (U const &mat) noexcept
 Creates a quaternion from a 3x3 rotation matrix.
 
template<Primitive T>
constexpr qua< T > mal_math::operator* (qua< T > const &q, qua< T > const &p) noexcept
 Quaternion-Quaternion multiplication.
 
template<Primitive T>
constexpr vec< 3, T > mal_math::operator* (qua< T > const &q, vec< 3, T > const &v) noexcept
 Quaternion-Vector multiplication.
 
template<Primitive T>
constexpr vec< 3, T > mal_math::operator* (vec< 3, T > const &v, qua< T > const &q) noexcept
 Vector-Quaternion multiplication.
 
template<Primitive T>
constexpr qua< T > mal_math::rotate (mat< 4, 4, T > const &matrix, qua< T > const &q) noexcept
 Rotates a 4x4 matrix using a quaternion.
 
template<Primitive T>
constexpr T mal_math::length (qua< T > const &q) noexcept
 Computes the length (or magnitude) of a quaternion.
 
template<Primitive T>
constexpr qua< T > mal_math::normalize (qua< T > const &q) noexcept
 Normalizes a quaternion.