NRE::Math::Matrix3x3< T > Class Template Reference

3x3 generic matrix More...

#include <NRE_Matrix3x3.hpp>

Inheritance diagram for NRE::Math::Matrix3x3< T >:

Public Member Functions

constexpr Matrix3x3 ()=default
 
template<class A , class B , class C , class D , class E , class F , class G , class H , class I >
constexpr Matrix3x3 (A a, B b, C c, D d, E e, F f, G g, H h, I i)
 
template<class K >
constexpr Matrix3x3 (K value)
 
template<class K , class L , class N >
constexpr Matrix3x3 (Vector3D< K > const &l1, Vector3D< L > const &l2, Vector3D< N > const &l3)
 
constexpr Matrix3x3 (Matrix3x3 const &m)=default
 
constexpr Matrix3x3 (Matrix3x3 &&m)=default
 
template<class K >
constexpr Matrix3x3 (Matrix3x3< K > const &m)
 
template<class K >
constexpr Matrix3x3 (Matrix4x4< K > const &m)
 
 ~Matrix3x3 ()=default
 
constexpr Vector3D< T > const & getL1 () const
 
constexpr Vector3D< T > const & getL2 () const
 
constexpr Vector3D< T > const & getL3 () const
 
constexpr Vector3D< T > getC1 () const
 
constexpr Vector3D< T > getC2 () const
 
constexpr Vector3D< T > getC3 () const
 
constexpr long double getDeterminant () const
 
template<class K >
constexpr void setL1 (Vector3D< K > const &l1)
 
template<class K >
constexpr void setL2 (Vector3D< K > const &l2)
 
template<class K >
constexpr void setL3 (Vector3D< K > const &l3)
 
template<class K >
constexpr void setC1 (Vector3D< K > const &c1)
 
template<class K >
constexpr void setC2 (Vector3D< K > const &c2)
 
template<class K >
constexpr void setC3 (Vector3D< K > const &c3)
 
constexpr Matrix3x3setIdentity ()
 
constexpr Matrix3x3transpose ()
 
constexpr Matrix3x3inverse ()
 
template<class K >
constexpr Matrix3x3translate (Vector2D< K > const &u)
 
template<class K >
constexpr Matrix3x3scale (Vector2D< K > const &u)
 
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3stretchX (K u)
 
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3stretchY (K u)
 
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3squeezeX (K u)
 
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3squeezeY (K u)
 
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3shearX (K u)
 
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3shearY (K u)
 
constexpr Matrix3x3rotate (Angle angle)
 
constexpr const T * value () const
 
constexpr Vector3D< T > & operator[] (std::size_t index)
 
constexpr Vector3D< T > const & operator[] (std::size_t index) const
 
constexpr Matrix3x3operator= (Matrix3x3 const &m)=default
 
constexpr Matrix3x3operator= (Matrix3x3 &&m)=default
 
template<class K >
constexpr Matrix3x3operator= (Matrix3x3< K > const &m)
 
template<class K >
constexpr Matrix3x3operator= (Matrix3x3< K > &&m)
 
template<class K >
constexpr Matrix3x3operator+= (Matrix3x3< K > const &m)
 
template<class K >
constexpr Matrix3x3operator-= (Matrix3x3< K > const &m)
 
template<class K >
constexpr Matrix3x3operator*= (K k)
 
template<class K >
constexpr Matrix3x3operator*= (Matrix3x3< K > const &m)
 
template<class K >
constexpr Matrix3x3operator/= (K k)
 
template<class K >
constexpr Matrix3x3operator/= (Matrix3x3< K > const &m)
 
template<class K >
constexpr Matrix3x3< std::common_type_t< T, K > > operator+ (Matrix3x3< K > const &m) const
 
template<class K >
constexpr Matrix3x3< std::common_type_t< T, K > > operator- (Matrix3x3< K > const &m) const
 
template<class K >
constexpr Matrix3x3< std::common_type_t< T, K > > operator* (K k) const
 
template<class K >
constexpr Matrix3x3< std::common_type_t< T, K > > operator* (Matrix3x3< K > const &m) const
 
template<class K >
constexpr Vector3D< K > operator* (Vector3D< K > const &u) const
 
template<class K >
constexpr Segment3D< K > operator* (Segment3D< K > const &s) const
 
constexpr BezierCurve3D operator* (BezierCurve3D const &c) const
 
template<class K >
constexpr Matrix3x3< std::common_type_t< T, K > > operator/ (K k) const
 
template<class K >
constexpr Matrix3x3< std::common_type_t< T, K > > operator/ (Matrix3x3< K > const &m) const
 
template<class K >
constexpr bool operator== (Matrix3x3< K > const &m) const
 
template<class K >
constexpr bool operator!= (Matrix3x3< K > const &m) const
 
Utility::String toString () const
 

Static Public Attributes

static constexpr Matrix3x3 IDENTITY = Matrix3x3(1, 0, 0, 0, 1, 0, 0, 0, 1)
 

Detailed Description

template<class T>
class NRE::Math::Matrix3x3< T >

3x3 generic matrix

Constructor & Destructor Documentation

template<class T>
constexpr NRE::Math::Matrix3x3< T >::Matrix3x3 ( )
default

Default constructor

template<class T>
template<class A , class B , class C , class D , class E , class F , class G , class H , class I >
constexpr NRE::Math::Matrix3x3< T >::Matrix3x3 ( a,
b,
c,
d,
e,
f,
g,
h,
i 
)

Construct a matrix with passed values

Parameters
afirst matrix component
bsecond matrix component
cthird matrix component
dfourth matrix component
efifth matrix component
fsixth matrix component
gseventh matrix component
heighth matrix component
ininth matrix component
template<class T>
template<class K >
constexpr NRE::Math::Matrix3x3< T >::Matrix3x3 ( value)

Construct a matrix with a unique value for all component

Parameters
valuenew value for all component
template<class T>
template<class K , class L , class N >
constexpr NRE::Math::Matrix3x3< T >::Matrix3x3 ( Vector3D< K > const &  l1,
Vector3D< L > const &  l2,
Vector3D< N > const &  l3 
)

Construct a matrix with their lines passed in parameters with vector

Parameters
l1the new value for the first line
l2the new value for the second line
l3the new value for the third line
template<class T>
constexpr NRE::Math::Matrix3x3< T >::Matrix3x3 ( Matrix3x3< T > const &  m)
default

Copy m into this

Parameters
mthe object to copy
template<class T>
constexpr NRE::Math::Matrix3x3< T >::Matrix3x3 ( Matrix3x3< T > &&  m)
default

Move m into this

Parameters
mthe object to move
template<class T>
template<class K >
constexpr NRE::Math::Matrix3x3< T >::Matrix3x3 ( Matrix3x3< K > const &  m)

Convert a K-type matrix into a T-type matrix

Parameters
mthe K-type matrix to convert
template<class T>
template<class K >
constexpr NRE::Math::Matrix3x3< T >::Matrix3x3 ( Matrix4x4< K > const &  m)

Convert a K-type 4x4 matrix into a T-type 3x3 matrix

Parameters
mthe K-type 4x4 matrix to convert
template<class T>
NRE::Math::Matrix3x3< T >::~Matrix3x3 ( )
default

Matrix3x3 Deconstructor

Member Function Documentation

template<class T>
constexpr Vector3D<T> NRE::Math::Matrix3x3< T >::getC1 ( ) const
Returns
the first column
template<class T>
constexpr Vector3D<T> NRE::Math::Matrix3x3< T >::getC2 ( ) const
Returns
the second column
template<class T>
constexpr Vector3D<T> NRE::Math::Matrix3x3< T >::getC3 ( ) const
Returns
the third column
template<class T>
constexpr long double NRE::Math::Matrix3x3< T >::getDeterminant ( ) const
Returns
the matrix's determinant
template<class T>
constexpr Vector3D<T> const& NRE::Math::Matrix3x3< T >::getL1 ( ) const
Returns
the first line
template<class T>
constexpr Vector3D<T> const& NRE::Math::Matrix3x3< T >::getL2 ( ) const
Returns
the second line
template<class T>
constexpr Vector3D<T> const& NRE::Math::Matrix3x3< T >::getL3 ( ) const
Returns
the third line
template<class T>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::inverse ( )

Inverse the matrix, if not possible the matrix become the identity one

Returns
the reference of himself
template<class T>
template<class K >
constexpr bool NRE::Math::Matrix3x3< T >::operator!= ( Matrix3x3< K > const &  m) const

Difference test between this and m

Parameters
mthe matrix to test with this
Returns
the test's result
template<class T>
template<class K >
constexpr Matrix3x3<std::common_type_t<T, K> > NRE::Math::Matrix3x3< T >::operator* ( k) const

Compute the matrix resulting in the multiplication of this by k

Parameters
kthe multiplication factor
Returns
the newly computed matrix
template<class T>
template<class K >
constexpr Matrix3x3<std::common_type_t<T, K> > NRE::Math::Matrix3x3< T >::operator* ( Matrix3x3< K > const &  m) const

Compute the matrix resulting in the multiplication of this and m

Parameters
mthe matrix to multiply with this
Returns
the newly computed matrix
template<class T>
template<class K >
constexpr Vector3D<K> NRE::Math::Matrix3x3< T >::operator* ( Vector3D< K > const &  u) const

Compute the vector resulting in the transformation of u by this

Parameters
uthe vector to transform
Returns
the newly computed vector
template<class T>
template<class K >
constexpr Segment3D<K> NRE::Math::Matrix3x3< T >::operator* ( Segment3D< K > const &  s) const

Compute the segment resulting in the transformation of s by this

Parameters
sthe segment to transform
Returns
the newly computed vector
template<class T>
constexpr BezierCurve3D NRE::Math::Matrix3x3< T >::operator* ( BezierCurve3D const &  c) const

Compute the bezier curve resulting in the transformation of c by this

Parameters
cthe bezier curve to transform
Returns
the newly computed vector
template<class T>
template<class K >
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::operator*= ( k)

Multiply this by k

Parameters
kthe multiplication factor
Returns
the reference of himself
template<class T>
template<class K >
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::operator*= ( Matrix3x3< K > const &  m)

Multiply this with m

Parameters
mthe matrix to multiply with this
Returns
the reference of himself
template<class T>
template<class K >
constexpr Matrix3x3<std::common_type_t<T, K> > NRE::Math::Matrix3x3< T >::operator+ ( Matrix3x3< K > const &  m) const

Compute the matrix resulting in the addition of this and m

Parameters
mthe matrix to add with this
Returns
the newly computed matrix
template<class T>
template<class K >
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::operator+= ( Matrix3x3< K > const &  m)

Add m into this

Parameters
mthe matrix to add into this
Returns
the reference on himself
template<class T>
template<class K >
constexpr Matrix3x3<std::common_type_t<T, K> > NRE::Math::Matrix3x3< T >::operator- ( Matrix3x3< K > const &  m) const

Compute the matrix resulting in the subtraction of this and m

Parameters
mthe matrix to subtract with this
Returns
the newly computed matrix
template<class T>
template<class K >
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::operator-= ( Matrix3x3< K > const &  m)

Subtract m into this

Parameters
mthe matrix to subtract into this
Returns
the reference on himself
template<class T>
template<class K >
constexpr Matrix3x3<std::common_type_t<T, K> > NRE::Math::Matrix3x3< T >::operator/ ( k) const

Compute the matrix resulting in the division of this by k

Parameters
kthe division factor
Returns
the newly computed matrix
template<class T>
template<class K >
constexpr Matrix3x3<std::common_type_t<T, K> > NRE::Math::Matrix3x3< T >::operator/ ( Matrix3x3< K > const &  m) const

Compute the matrix resulting in the division of this and m

Parameters
mthe matrix to divide with this
Returns
the newly computed matrix
template<class T>
template<class K >
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::operator/= ( k)

Divide this by k

Parameters
kthe division factor
Returns
the reference of himself
template<class T>
template<class K >
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::operator/= ( Matrix3x3< K > const &  m)

Divide this with m

Parameters
mthe matrix to divide with this
Returns
the reference of himself
template<class T>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::operator= ( Matrix3x3< T > const &  m)
default

Copy m into this

Parameters
mthe object to copy into this
Returns
the reference of himself
template<class T>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::operator= ( Matrix3x3< T > &&  m)
default

Move m into this

Parameters
mthe object to move into this
Returns
the reference of himself
template<class T>
template<class K >
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::operator= ( Matrix3x3< K > const &  m)

Copy m into this

Parameters
mthe object to copy into this
Returns
the reference of himself
template<class T>
template<class K >
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::operator= ( Matrix3x3< K > &&  m)

Move m into this

Parameters
mthe object to move into this
Returns
the reference of himself
template<class T>
template<class K >
constexpr bool NRE::Math::Matrix3x3< T >::operator== ( Matrix3x3< K > const &  m) const

Equality test between this and m

Parameters
mthe matrix to test with this
Returns
the test's result
template<class T>
constexpr Vector3D<T>& NRE::Math::Matrix3x3< T >::operator[] ( std::size_t  index)

Return a reference on a matrix's line

Warning
No range check performed
Parameters
indexthe line's index
Returns
the line's reference
template<class T>
constexpr Vector3D<T> const& NRE::Math::Matrix3x3< T >::operator[] ( std::size_t  index) const

Return a const reference on a matrix's line

Warning
No range check performed
Parameters
indexthe line's index
Returns
the line's reference
template<class T>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::rotate ( Angle  angle)

Add a rotation

Parameters
anglethe rotation's angle
Returns
the reference of himself
template<class T>
template<class K >
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::scale ( Vector2D< K > const &  u)

Add a scale

Parameters
uthe scaling vector
Returns
the reference of himself
template<class T>
template<class K >
constexpr void NRE::Math::Matrix3x3< T >::setC1 ( Vector3D< K > const &  c1)

First column setter

Parameters
c1the new first column vector
template<class T>
template<class K >
constexpr void NRE::Math::Matrix3x3< T >::setC2 ( Vector3D< K > const &  c2)

Second column setter

Parameters
c2the new second column vector
template<class T>
template<class K >
constexpr void NRE::Math::Matrix3x3< T >::setC3 ( Vector3D< K > const &  c3)

Third column setter

Parameters
c3the new third column vector
template<class T>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::setIdentity ( )

Set the matrix to the identity matrix

Returns
the reference of himself
template<class T>
template<class K >
constexpr void NRE::Math::Matrix3x3< T >::setL1 ( Vector3D< K > const &  l1)

First line setter

Parameters
l1the new first line vector
template<class T>
template<class K >
constexpr void NRE::Math::Matrix3x3< T >::setL2 ( Vector3D< K > const &  l2)

Second line setter

Parameters
l2the new second line vector
template<class T>
template<class K >
constexpr void NRE::Math::Matrix3x3< T >::setL3 ( Vector3D< K > const &  l3)

Third line setter

Parameters
l3the new third line vector
template<class T>
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::shearX ( u)
inline

Add a shear on the X axis

Parameters
uthe shear factor
Returns
the reference of himself
template<class T>
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::shearY ( u)
inline

Add a shear on the Y axis

Parameters
uthe shear factor
Returns
the reference of himself
template<class T>
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::squeezeX ( u)
inline

Add a squeeze on the X axis

Parameters
uthe squeeze factor
Returns
the reference of himself
template<class T>
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::squeezeY ( u)
inline

Add a squeeze on the Y axis

Parameters
uthe squeeze factor
Returns
the reference of himself
template<class T>
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::stretchX ( u)
inline

Add a stretch on the X axis

Parameters
uthe stretch factor
Returns
the reference of himself
template<class T>
template<class K , typename = UseIfArithmetic<K>>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::stretchY ( u)
inline

Add a stretch on the Y axis

Parameters
uthe stretch factor
Returns
the reference of himself
template<class T>
Utility::String NRE::Math::Matrix3x3< T >::toString ( ) const

Convert the matrix into a string

Returns
the converted matrix
template<class T>
template<class K >
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::translate ( Vector2D< K > const &  u)

Add a translation

Parameters
uthe translation vector
Returns
the reference of himself
template<class T>
constexpr Matrix3x3& NRE::Math::Matrix3x3< T >::transpose ( )

Transpose the matrix

Returns
the reference of himself
template<class T>
constexpr const T* NRE::Math::Matrix3x3< T >::value ( ) const
Returns
a pointer to the vector's data

Member Data Documentation

template<class T>
constexpr Matrix3x3 NRE::Math::Matrix3x3< T >::IDENTITY = Matrix3x3(1, 0, 0, 0, 1, 0, 0, 0, 1)
static

Identity matrix


The documentation for this class was generated from the following file: