Antkeeper  0.0.1
Functions
math::operators Namespace Reference

Mathematical operators. More...

Functions

template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator+ (const matrix< T, N, M > &a, const matrix< T, N, M > &b) noexcept
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator/ (const matrix< T, N, M > &a, const matrix< T, N, M > &b) noexcept
 Divides a matrix by a matrix. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator/ (const matrix< T, N, M > &a, T b) noexcept
 Divides a matrix by a scalar. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator/ (T a, const matrix< T, N, M > &b) noexcept
 Divides a scalar by a matrix. More...
 
template<class T , std::size_t N, std::size_t M, std::size_t P>
constexpr matrix< T, P, M > operator* (const matrix< T, N, M > &a, const matrix< T, P, N > &b) noexcept
 Multiplies two matrices. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M >::column_vector_type operator* (const matrix< T, N, M > &a, const typename matrix< T, N, M >::row_vector_type &b) noexcept
 Calculates the product of a matrix and a row vector. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M >::row_vector_type operator* (const typename matrix< T, N, M >::column_vector_type &a, const matrix< T, N, M > &b) noexcept
 Calculates the product of a column vector and a matrix. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator- (const matrix< T, N, M > &a, const matrix< T, N, M > &b) noexcept
 Subtracts a matrix from another matrix. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator- (const matrix< T, N, M > &a, T b) noexcept
 Subtracts a scalar from matrix. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator- (T a, const matrix< T, N, M > &b) noexcept
 Subtracts a matrix from a scalar. More...
 
template<class T >
constexpr quaternion< T > operator+ (const quaternion< T > &a, const quaternion< T > &b) noexcept
 
template<class T >
constexpr quaternion< T > operator/ (const quaternion< T > &a, const quaternion< T > &b) noexcept
 Divides a quaternion by another quaternion. More...
 
template<class T >
constexpr quaternion< T > operator/ (const quaternion< T > &a, T b) noexcept
 Divides a quaternion by a scalar. More...
 
template<class T >
constexpr quaternion< T > operator/ (T a, const quaternion< T > &b) noexcept
 Divides a scalar by a quaternion. More...
 
template<class T >
constexpr quaternion< T > operator* (const quaternion< T > &a, const quaternion< T > &b) noexcept
 Multiplies two quaternions. More...
 
template<class T >
constexpr vec3< T > operator* (const quaternion< T > &q, const vec3< T > &v) noexcept
 Rotates a vector by a unit quaternion. More...
 
template<class T >
constexpr vec3< T > operator* (const vec3< T > &v, const quaternion< T > &q) noexcept
 Rotates a vector by the inverse of a unit quaternion. More...
 
template<class T >
constexpr quaternion< T > operator- (const quaternion< T > &a, const quaternion< T > &b) noexcept
 Subtracts a quaternion from another quaternion. More...
 
template<class T >
constexpr quaternion< T > operator- (const quaternion< T > &q) noexcept
 Negates a quaternion. More...
 
template<class T >
math::transform< T > operator* (const math::transform< T > &x, const math::transform< T > &y)
 Combines two transforms. More...
 
template<class T >
constexpr math::vec3< T > operator* (const math::transform< T > &t, const math::vec3< T > &v) noexcept
 
template<class T >
constexpr math::vec3< T > operator* (const math::vec3< T > &v, const math::transform< T > &t) noexcept
 
template<class T >
math::transform< T > & operator*= (math::transform< T > &x, const math::transform< T > &y)
 Combines two transforms and stores the result in the first transform. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > operator+ (const vector< T, N > &x, const vector< T, N > &y) noexcept
 
template<class T , std::size_t N>
constexpr vector< T, N > operator/ (const vector< T, N > &x, const vector< T, N > &y) noexcept
 Divides a vector by a value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > operator/ (const vector< T, N > &x, T y) noexcept
 Divides a vector by a value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > operator/ (T x, const vector< T, N > &y) noexcept
 Divides a vector by a value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > operator* (const vector< T, N > &x, const vector< T, N > &y) noexcept
 Multiplies two values. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > operator- (const vector< T, N > &x) noexcept
 Negates a vector. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > operator- (const vector< T, N > &x, const vector< T, N > &y) noexcept
 Subtracts a value by another value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > operator- (const vector< T, N > &x, T y) noexcept
 Subtracts a value by another value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > operator- (T x, const vector< T, N > &y) noexcept
 Subtracts a value by another value. More...
 
template<class T , std::size_t N>
constexpr bool operator== (const vector< T, N > &x, const vector< T, N > &y) noexcept
 Tests two vector for equality. More...
 
template<class T , std::size_t N>
constexpr bool operator!= (const vector< T, N > &x, const vector< T, N > &y) noexcept
 Tests two vector for inequality. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator+ (const matrix< T, N, M > &a, T b) noexcept
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator+ (T a, const matrix< T, N, M > &b) noexcept
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator* (const matrix< T, N, M > &a, T b) noexcept
 Multiplies a matrix by a scalar. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > operator* (T a, const matrix< T, N, M > &b) noexcept
 Multiplies a matrix by a scalar. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > & operator+= (matrix< T, N, M > &a, const matrix< T, N, M > &b) noexcept
 Adds two values and stores the result in the first value. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > & operator+= (matrix< T, N, M > &a, T b) noexcept
 Adds two values and stores the result in the first value. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > & operator-= (matrix< T, N, M > &a, const matrix< T, N, M > &b) noexcept
 Subtracts the first value by the second value and stores the result in the first value. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > & operator-= (matrix< T, N, M > &a, T b) noexcept
 Subtracts the first value by the second value and stores the result in the first value. More...
 
template<class T , std::size_t N>
constexpr matrix< T, N, N > & operator*= (matrix< T, N, N > &a, const matrix< T, N, N > &b) noexcept
 Multiplies two values and stores the result in the first value. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > & operator*= (matrix< T, N, M > &a, T b) noexcept
 Multiplies two values and stores the result in the first value. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > & operator/= (matrix< T, N, M > &a, const matrix< T, N, M > &b) noexcept
 Divides the first value by the second value and stores the result in the first value. More...
 
template<class T , std::size_t N, std::size_t M>
constexpr matrix< T, N, M > & operator/= (matrix< T, N, M > &a, T b) noexcept
 Divides the first value by the second value and stores the result in the first value. More...
 
template<class T >
constexpr quaternion< T > operator+ (const quaternion< T > &a, T b) noexcept
 
template<class T >
constexpr quaternion< T > operator+ (T a, const quaternion< T > &b) noexcept
 
template<class T >
constexpr quaternion< T > operator* (const quaternion< T > &a, T b) noexcept
 Multiplies a quaternion by a scalar. More...
 
template<class T >
constexpr quaternion< T > operator* (T a, const quaternion< T > &b) noexcept
 Multiplies a quaternion by a scalar. More...
 
template<class T >
constexpr quaternion< T > operator- (const quaternion< T > &a, T b) noexcept
 Subtracts a quaternion and a scalar. More...
 
template<class T >
constexpr quaternion< T > operator- (T a, const quaternion< T > &b) noexcept
 Subtracts a quaternion and a scalar. More...
 
template<class T >
constexpr quaternion< T > & operator+= (quaternion< T > &a, const quaternion< T > &b) noexcept
 Adds two values and stores the result in the first value. More...
 
template<class T >
constexpr quaternion< T > & operator+= (quaternion< T > &a, T b) noexcept
 Adds two values and stores the result in the first value. More...
 
template<class T >
constexpr quaternion< T > & operator-= (quaternion< T > &a, const quaternion< T > &b) noexcept
 Subtracts the first value by the second value and stores the result in the first value. More...
 
template<class T >
constexpr quaternion< T > & operator-= (quaternion< T > &a, T b) noexcept
 Subtracts the first value by the second value and stores the result in the first value. More...
 
template<class T >
constexpr quaternion< T > & operator*= (quaternion< T > &a, const quaternion< T > &b) noexcept
 Multiplies two values and stores the result in the first value. More...
 
template<class T >
constexpr quaternion< T > & operator*= (quaternion< T > &a, T b) noexcept
 Multiplies two values and stores the result in the first value. More...
 
template<class T >
constexpr quaternion< T > & operator/= (quaternion< T > &a, const quaternion< T > &b) noexcept
 Divides the first value by the second value and stores the result in the first value. More...
 
template<class T >
constexpr quaternion< T > & operator/= (quaternion< T > &a, T b) noexcept
 Divides the first value by the second value and stores the result in the first value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > operator+ (const vector< T, N > &x, T y) noexcept
 
template<class T , std::size_t N>
constexpr vector< T, N > operator+ (T x, const vector< T, N > &y) noexcept
 
template<class T , std::size_t N>
constexpr vector< T, N > operator* (const vector< T, N > &x, T y) noexcept
 Multiplies two values. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > operator* (T x, const vector< T, N > &y) noexcept
 Multiplies two values. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > & operator+= (vector< T, N > &x, const vector< T, N > &y) noexcept
 Adds two values and stores the result in the first value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > & operator+= (vector< T, N > &x, T y) noexcept
 Adds two values and stores the result in the first value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > & operator-= (vector< T, N > &x, const vector< T, N > &y) noexcept
 Subtracts the first value by the second value and stores the result in the first value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > & operator-= (vector< T, N > &x, T y) noexcept
 Subtracts the first value by the second value and stores the result in the first value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > & operator*= (vector< T, N > &x, const vector< T, N > &y) noexcept
 Multiplies two values and stores the result in the first value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > & operator*= (vector< T, N > &x, T y) noexcept
 Multiplies two values and stores the result in the first value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > & operator/= (vector< T, N > &x, const vector< T, N > &y) noexcept
 Divides the first value by the second value and stores the result in the first value. More...
 
template<class T , std::size_t N>
constexpr vector< T, N > & operator/= (vector< T, N > &x, T y) noexcept
 Divides the first value by the second value and stores the result in the first value. More...
 

Detailed Description

Mathematical operators.

Function Documentation

◆ operator!=()

template<class T , std::size_t N>
constexpr bool math::operators::operator!= ( const vector< T, N > &  x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Tests two vector for inequality.

Parameters
xFirst value.
ySecond value.
Returns
false if the vectors are identical, true otherwise.

Definition at line 1830 of file vector.hpp.

◆ operator*() [1/16]

template<class T >
constexpr math::vec3<T> math::operators::operator* ( const math::transform< T > &  t,
const math::vec3< T > &  v 
)
inlineconstexprnoexcept

Definition at line 194 of file transform.hpp.

◆ operator*() [2/16]

template<class T >
math::transform<T> math::operators::operator* ( const math::transform< T > &  x,
const math::transform< T > &  y 
)
inline

Combines two transforms.

Parameters
xFirst transform.
ySecond transform.
Returns
Product of the two transforms.

Definition at line 187 of file transform.hpp.

◆ operator*() [3/16]

template<class T >
constexpr math::vec3<T> math::operators::operator* ( const math::vec3< T > &  v,
const math::transform< T > &  t 
)
inlineconstexprnoexcept

Definition at line 201 of file transform.hpp.

◆ operator*() [4/16]

template<class T , std::size_t N, std::size_t M, std::size_t P>
constexpr matrix<T, P, M> math::operators::operator* ( const matrix< T, N, M > &  a,
const matrix< T, P, N > &  b 
)
inlineconstexprnoexcept

Multiplies two matrices.

Template Parameters
TMatrix element type.
NNumber of columns in matrix a, and rows in matrix b.
MNumber of rows in matrix a.
PNumber of columns in matrix b.
Parameters
aFirst matrix.
bSecond matrix.
Returns
Product of a * b.

Definition at line 1289 of file math/matrix.hpp.

◆ operator*() [5/16]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M>::column_vector_type math::operators::operator* ( const matrix< T, N, M > &  a,
const typename matrix< T, N, M >::row_vector_type &  b 
)
inlineconstexprnoexcept

Calculates the product of a matrix and a row vector.

Parameters
aMatrix.
bRow vector
Returns
Product of the matrix and the row vector.

Definition at line 1310 of file math/matrix.hpp.

◆ operator*() [6/16]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator* ( const matrix< T, N, M > &  a,
b 
)
inlineconstexprnoexcept

Multiplies a matrix by a scalar.

Parameters
aMatrix.
bScalar.
Returns
Product of the matrix and the scalar.

Definition at line 1297 of file math/matrix.hpp.

◆ operator*() [7/16]

template<class T >
constexpr quaternion<T> math::operators::operator* ( const quaternion< T > &  a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Multiplies two quaternions.

Parameters
aFirst quaternion.
bSecond quaternion.
Returns
Product of the two quaternions.

Definition at line 903 of file quaternion.hpp.

◆ operator*() [8/16]

template<class T >
constexpr quaternion<T> math::operators::operator* ( const quaternion< T > &  a,
b 
)
inlineconstexprnoexcept

Multiplies a quaternion by a scalar.

Parameters
aFirst value.
bSecond value.
Returns
Product of the quaternion and scalar.

Definition at line 911 of file quaternion.hpp.

◆ operator*() [9/16]

template<class T >
constexpr vec3<T> math::operators::operator* ( const quaternion< T > &  q,
const vec3< T > &  v 
)
inlineconstexprnoexcept

Rotates a vector by a unit quaternion.

Parameters
qUnit quaternion.
vVector to rotate.
Returns
Rotated vector.
Warning
q must be a unit quaternion.
See also
https://fgiesen.wordpress.com/2019/02/09/rotating-a-single-vector-using-a-quaternion/

Definition at line 924 of file quaternion.hpp.

◆ operator*() [10/16]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M>::row_vector_type math::operators::operator* ( const typename matrix< T, N, M >::column_vector_type &  a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Calculates the product of a column vector and a matrix.

Parameters
aColumn vector.
bMatrix.
Returns
Product of the column vector and the matrix.

Definition at line 1317 of file math/matrix.hpp.

◆ operator*() [11/16]

template<class T >
constexpr vec3<T> math::operators::operator* ( const vec3< T > &  v,
const quaternion< T > &  q 
)
inlineconstexprnoexcept

Rotates a vector by the inverse of a unit quaternion.

Parameters
vVector to rotate.
qUnit quaternion.
Returns
Rotated vector.
Warning
q must be a unit quaternion.

Definition at line 931 of file quaternion.hpp.

◆ operator*() [12/16]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator* ( const vector< T, N > &  x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Multiplies two values.

Parameters
xFirst value.
ySecond value.
Returns
Product of the two values.

Definition at line 1661 of file vector.hpp.

◆ operator*() [13/16]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator* ( const vector< T, N > &  x,
y 
)
inlineconstexprnoexcept

Multiplies two values.

Parameters
xFirst value.
ySecond value.
Returns
Product of the two values.

Definition at line 1669 of file vector.hpp.

◆ operator*() [14/16]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator* ( a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Multiplies a matrix by a scalar.

Parameters
aMatrix.
bScalar.
Returns
Product of the matrix and the scalar.

Definition at line 1302 of file math/matrix.hpp.

◆ operator*() [15/16]

template<class T >
constexpr quaternion<T> math::operators::operator* ( a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Multiplies a quaternion by a scalar.

Parameters
aFirst value.
bSecond value.
Returns
Product of the quaternion and scalar.

Definition at line 916 of file quaternion.hpp.

◆ operator*() [16/16]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator* ( x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Multiplies two values.

Parameters
xFirst value.
ySecond value.
Returns
Product of the two values.

Definition at line 1674 of file vector.hpp.

◆ operator*=() [1/7]

template<class T >
math::transform<T>& math::operators::operator*= ( math::transform< T > &  x,
const math::transform< T > &  y 
)
inline

Combines two transforms and stores the result in the first transform.

Parameters
xFirst transform.
ySecond transform.
Returns
Reference to the first transform.

Definition at line 215 of file transform.hpp.

◆ operator*=() [2/7]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M>& math::operators::operator*= ( matrix< T, N, M > &  a,
b 
)
inlineconstexprnoexcept

Multiplies two values and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1400 of file math/matrix.hpp.

◆ operator*=() [3/7]

template<class T , std::size_t N>
constexpr matrix<T, N, N>& math::operators::operator*= ( matrix< T, N, N > &  a,
const matrix< T, N, N > &  b 
)
inlineconstexprnoexcept

Multiplies two values and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1395 of file math/matrix.hpp.

◆ operator*=() [4/7]

template<class T >
constexpr quaternion<T>& math::operators::operator*= ( quaternion< T > &  a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Multiplies two values and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1016 of file quaternion.hpp.

◆ operator*=() [5/7]

template<class T >
constexpr quaternion<T>& math::operators::operator*= ( quaternion< T > &  a,
b 
)
inlineconstexprnoexcept

Multiplies two values and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1021 of file quaternion.hpp.

◆ operator*=() [6/7]

template<class T , std::size_t N>
constexpr vector<T, N>& math::operators::operator*= ( vector< T, N > &  x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Multiplies two values and stores the result in the first value.

Parameters
xFirst value.
ySecond value.
Returns
Reference to the first value.

Definition at line 1760 of file vector.hpp.

◆ operator*=() [7/7]

template<class T , std::size_t N>
constexpr vector<T, N>& math::operators::operator*= ( vector< T, N > &  x,
y 
)
inlineconstexprnoexcept

Multiplies two values and stores the result in the first value.

Parameters
xFirst value.
ySecond value.
Returns
Reference to the first value.

Definition at line 1765 of file vector.hpp.

◆ operator+() [1/9]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator+ ( const matrix< T, N, M > &  a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Definition at line 1247 of file math/matrix.hpp.

◆ operator+() [2/9]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator+ ( const matrix< T, N, M > &  a,
b 
)
inlineconstexprnoexcept

Definition at line 1255 of file math/matrix.hpp.

◆ operator+() [3/9]

template<class T >
constexpr quaternion<T> math::operators::operator+ ( const quaternion< T > &  a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Definition at line 861 of file quaternion.hpp.

◆ operator+() [4/9]

template<class T >
constexpr quaternion<T> math::operators::operator+ ( const quaternion< T > &  a,
b 
)
inlineconstexprnoexcept

Definition at line 869 of file quaternion.hpp.

◆ operator+() [5/9]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator+ ( const vector< T, N > &  x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Definition at line 1619 of file vector.hpp.

◆ operator+() [6/9]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator+ ( const vector< T, N > &  x,
y 
)
inlineconstexprnoexcept

Definition at line 1627 of file vector.hpp.

◆ operator+() [7/9]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator+ ( a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Definition at line 1260 of file math/matrix.hpp.

◆ operator+() [8/9]

template<class T >
constexpr quaternion<T> math::operators::operator+ ( a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Definition at line 874 of file quaternion.hpp.

◆ operator+() [9/9]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator+ ( x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Definition at line 1632 of file vector.hpp.

◆ operator+=() [1/6]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M>& math::operators::operator+= ( matrix< T, N, M > &  a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Adds two values and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1353 of file math/matrix.hpp.

◆ operator+=() [2/6]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M>& math::operators::operator+= ( matrix< T, N, M > &  a,
b 
)
inlineconstexprnoexcept

Adds two values and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1358 of file math/matrix.hpp.

◆ operator+=() [3/6]

template<class T >
constexpr quaternion<T>& math::operators::operator+= ( quaternion< T > &  a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Adds two values and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 974 of file quaternion.hpp.

◆ operator+=() [4/6]

template<class T >
constexpr quaternion<T>& math::operators::operator+= ( quaternion< T > &  a,
b 
)
inlineconstexprnoexcept

Adds two values and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 979 of file quaternion.hpp.

◆ operator+=() [5/6]

template<class T , std::size_t N>
constexpr vector<T, N>& math::operators::operator+= ( vector< T, N > &  x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Adds two values and stores the result in the first value.

Parameters
xFirst value.
ySecond value.
Returns
Reference to the first value.

Definition at line 1718 of file vector.hpp.

◆ operator+=() [6/6]

template<class T , std::size_t N>
constexpr vector<T, N>& math::operators::operator+= ( vector< T, N > &  x,
y 
)
inlineconstexprnoexcept

Adds two values and stores the result in the first value.

Parameters
xFirst value.
ySecond value.
Returns
Reference to the first value.

Definition at line 1723 of file vector.hpp.

◆ operator-() [1/11]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator- ( const matrix< T, N, M > &  a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Subtracts a matrix from another matrix.

Parameters
aFirst matrix.
bSecond matrix.
Returns
Difference between the two matrices.

Definition at line 1324 of file math/matrix.hpp.

◆ operator-() [2/11]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator- ( const matrix< T, N, M > &  a,
b 
)
inlineconstexprnoexcept

Subtracts a scalar from matrix.

Parameters
aMatrix.
bScalar.
Returns
Difference between the matrix and scalar.

Definition at line 1331 of file math/matrix.hpp.

◆ operator-() [3/11]

template<class T >
constexpr quaternion<T> math::operators::operator- ( const quaternion< T > &  a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Subtracts a quaternion from another quaternion.

Parameters
aFirst quaternion.
bSecond quaternion.
Returns
Difference between the quaternions.

Definition at line 938 of file quaternion.hpp.

◆ operator-() [4/11]

template<class T >
constexpr quaternion<T> math::operators::operator- ( const quaternion< T > &  a,
b 
)
inlineconstexprnoexcept

Subtracts a quaternion and a scalar.

Parameters
aFirst value.
bSecond second.
Returns
Difference between the quaternion and scalar.

Definition at line 946 of file quaternion.hpp.

◆ operator-() [5/11]

template<class T >
constexpr quaternion<T> math::operators::operator- ( const quaternion< T > &  q)
inlineconstexprnoexcept

Negates a quaternion.

Parameters
qQuaternion to negate.
Returns
Negated quaternion.

Definition at line 959 of file quaternion.hpp.

◆ operator-() [6/11]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator- ( const vector< T, N > &  x)
inlineconstexprnoexcept

Negates a vector.

Parameters
xVector to negate.
Returns
Negated vector.

Definition at line 1682 of file vector.hpp.

◆ operator-() [7/11]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator- ( const vector< T, N > &  x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Subtracts a value by another value.

Parameters
xFirst value.
ySecond value.
Returns
Difference between the two values.

Definition at line 1689 of file vector.hpp.

◆ operator-() [8/11]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator- ( const vector< T, N > &  x,
y 
)
inlineconstexprnoexcept

Subtracts a value by another value.

Parameters
xFirst value.
ySecond value.
Returns
Difference between the two values.

Definition at line 1696 of file vector.hpp.

◆ operator-() [9/11]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator- ( a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Subtracts a matrix from a scalar.

Parameters
aScalar.
bMatrix.
Returns
Difference between the scalar and matrix.

Definition at line 1338 of file math/matrix.hpp.

◆ operator-() [10/11]

template<class T >
constexpr quaternion<T> math::operators::operator- ( a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Subtracts a quaternion and a scalar.

Parameters
aFirst value.
bSecond second.
Returns
Difference between the quaternion and scalar.

Definition at line 951 of file quaternion.hpp.

◆ operator-() [11/11]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator- ( x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Subtracts a value by another value.

Parameters
xFirst value.
ySecond value.
Returns
Difference between the two values.

Definition at line 1703 of file vector.hpp.

◆ operator-=() [1/6]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M>& math::operators::operator-= ( matrix< T, N, M > &  a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Subtracts the first value by the second value and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1374 of file math/matrix.hpp.

◆ operator-=() [2/6]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M>& math::operators::operator-= ( matrix< T, N, M > &  a,
b 
)
inlineconstexprnoexcept

Subtracts the first value by the second value and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1379 of file math/matrix.hpp.

◆ operator-=() [3/6]

template<class T >
constexpr quaternion<T>& math::operators::operator-= ( quaternion< T > &  a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Subtracts the first value by the second value and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 995 of file quaternion.hpp.

◆ operator-=() [4/6]

template<class T >
constexpr quaternion<T>& math::operators::operator-= ( quaternion< T > &  a,
b 
)
inlineconstexprnoexcept

Subtracts the first value by the second value and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1000 of file quaternion.hpp.

◆ operator-=() [5/6]

template<class T , std::size_t N>
constexpr vector<T, N>& math::operators::operator-= ( vector< T, N > &  x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Subtracts the first value by the second value and stores the result in the first value.

Parameters
xFirst value.
ySecond value.
Returns
Reference to the first value.

Definition at line 1739 of file vector.hpp.

◆ operator-=() [6/6]

template<class T , std::size_t N>
constexpr vector<T, N>& math::operators::operator-= ( vector< T, N > &  x,
y 
)
inlineconstexprnoexcept

Subtracts the first value by the second value and stores the result in the first value.

Parameters
xFirst value.
ySecond value.
Returns
Reference to the first value.

Definition at line 1744 of file vector.hpp.

◆ operator/() [1/9]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator/ ( const matrix< T, N, M > &  a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Divides a matrix by a matrix.

Parameters
aFirst matrix.
bSecond matrix.
Returns
Result of the division.

Definition at line 1268 of file math/matrix.hpp.

◆ operator/() [2/9]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator/ ( const matrix< T, N, M > &  a,
b 
)
inlineconstexprnoexcept

Divides a matrix by a scalar.

Parameters
aMatrix.
bScalar.
Returns
Result of the division.

Definition at line 1275 of file math/matrix.hpp.

◆ operator/() [3/9]

template<class T >
constexpr quaternion<T> math::operators::operator/ ( const quaternion< T > &  a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Divides a quaternion by another quaternion.

Parameters
aFirst value.
bSecond value.
Returns
Result of the division.

Definition at line 882 of file quaternion.hpp.

◆ operator/() [4/9]

template<class T >
constexpr quaternion<T> math::operators::operator/ ( const quaternion< T > &  a,
b 
)
inlineconstexprnoexcept

Divides a quaternion by a scalar.

Parameters
aQuaternion.
bScalar.
Returns
Result of the division.

Definition at line 889 of file quaternion.hpp.

◆ operator/() [5/9]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator/ ( const vector< T, N > &  x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Divides a vector by a value.

Parameters
xFirst value.
ySecond value.
Returns
Result of the division.

Definition at line 1640 of file vector.hpp.

◆ operator/() [6/9]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator/ ( const vector< T, N > &  x,
y 
)
inlineconstexprnoexcept

Divides a vector by a value.

Parameters
xFirst value.
ySecond value.
Returns
Result of the division.

Definition at line 1647 of file vector.hpp.

◆ operator/() [7/9]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M> math::operators::operator/ ( a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Divides a scalar by a matrix.

Parameters
aScalar.
bMatrix.
Returns
Result of the division.

Definition at line 1282 of file math/matrix.hpp.

◆ operator/() [8/9]

template<class T >
constexpr quaternion<T> math::operators::operator/ ( a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Divides a scalar by a quaternion.

Parameters
aScalar.
bQuaternion.
Returns
Result of the division.

Definition at line 896 of file quaternion.hpp.

◆ operator/() [9/9]

template<class T , std::size_t N>
constexpr vector<T, N> math::operators::operator/ ( x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Divides a vector by a value.

Parameters
xFirst value.
ySecond value.
Returns
Result of the division.

Definition at line 1654 of file vector.hpp.

◆ operator/=() [1/6]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M>& math::operators::operator/= ( matrix< T, N, M > &  a,
const matrix< T, N, M > &  b 
)
inlineconstexprnoexcept

Divides the first value by the second value and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1416 of file math/matrix.hpp.

◆ operator/=() [2/6]

template<class T , std::size_t N, std::size_t M>
constexpr matrix<T, N, M>& math::operators::operator/= ( matrix< T, N, M > &  a,
b 
)
inlineconstexprnoexcept

Divides the first value by the second value and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1421 of file math/matrix.hpp.

◆ operator/=() [3/6]

template<class T >
constexpr quaternion<T>& math::operators::operator/= ( quaternion< T > &  a,
const quaternion< T > &  b 
)
inlineconstexprnoexcept

Divides the first value by the second value and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1037 of file quaternion.hpp.

◆ operator/=() [4/6]

template<class T >
constexpr quaternion<T>& math::operators::operator/= ( quaternion< T > &  a,
b 
)
inlineconstexprnoexcept

Divides the first value by the second value and stores the result in the first value.

Parameters
aFirst value.
bSecond value.
Returns
Reference to the first value.

Definition at line 1042 of file quaternion.hpp.

◆ operator/=() [5/6]

template<class T , std::size_t N>
constexpr vector<T, N>& math::operators::operator/= ( vector< T, N > &  x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Divides the first value by the second value and stores the result in the first value.

Parameters
xFirst value.
ySecond value.
Returns
Reference to the first value.

Definition at line 1781 of file vector.hpp.

◆ operator/=() [6/6]

template<class T , std::size_t N>
constexpr vector<T, N>& math::operators::operator/= ( vector< T, N > &  x,
y 
)
inlineconstexprnoexcept

Divides the first value by the second value and stores the result in the first value.

Parameters
xFirst value.
ySecond value.
Returns
Reference to the first value.

Definition at line 1786 of file vector.hpp.

◆ operator==()

template<class T , std::size_t N>
constexpr bool math::operators::operator== ( const vector< T, N > &  x,
const vector< T, N > &  y 
)
inlineconstexprnoexcept

Tests two vector for equality.

Parameters
xFirst value.
ySecond value.
Returns
true if the vectors are identical, false otherwise.

Definition at line 1801 of file vector.hpp.