Visualization Library 2.0.0-b3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
vl::Matrix3< T_Scalar > Class Template Reference

The Matrix3 class is a template class that implements a generic 3x3 matrix, see also vl::dmat3, vl::fmat3, vl::umat3, vl::imat3. More...

#include <Matrix3.hpp>

Public Types

typedef T_Scalar scalar_type
 

Public Member Functions

template<typename T >
 Matrix3 (const Matrix3< T > &m)
 
 Matrix3 ()
 
 Matrix3 (T_Scalar n)
 
 Matrix3 (T_Scalar e00, T_Scalar e01, T_Scalar e02, T_Scalar e10, T_Scalar e11, T_Scalar e12, T_Scalar e20, T_Scalar e21, T_Scalar e22)
 
Matrix3fill (T_Scalar val)
 
T_Scalar diff (const Matrix3 &other) const
 
Vector2< T_Scalar > getX () const
 
Vector2< T_Scalar > getY () const
 
Vector2< T_Scalar > getT () const
 
Matrix3setX (const Vector2< T_Scalar > &v)
 
Matrix3setY (const Vector2< T_Scalar > &v)
 
Matrix3setT (const Vector2< T_Scalar > &v)
 
bool operator== (const Matrix3 &m) const
 
bool operator!= (const Matrix3 &m) const
 
Matrix3operator= (const Matrix3 &m)
 
Matrix3 operator+ (const Matrix3 &m) const
 
Matrix3operator+= (const Matrix3 &m)
 
Matrix3 operator- (const Matrix3 &m) const
 
Matrix3operator-= (const Matrix3 &m)
 
Matrix3operator*= (const Matrix3 &m)
 
Matrix3 operator- () const
 
Matrix3 operator+ (T_Scalar d) const
 
Matrix3operator+= (T_Scalar d)
 
Matrix3 operator- (T_Scalar d) const
 
Matrix3operator-= (T_Scalar d)
 
Matrix3 operator* (T_Scalar d) const
 
Matrix3operator*= (T_Scalar d)
 
Matrix3 operator/ (T_Scalar d) const
 
Matrix3operator/= (T_Scalar d)
 
bool isIdentity () const
 
Matrix2< T_Scalar > get2x2 () const
 
void set2x2 (const Matrix2< T_Scalar > &m)
 This writes only on the upper 2x2 part of the matrix without touching the last row and column. More...
 
T_Scalar * ptr ()
 
const T_Scalar * ptr () const
 
Matrix3transpose ()
 
Matrix3 getTransposed () const
 
Matrix3getTransposed (Matrix3 &dest) const
 
bool isNull () const
 
Matrix3setNull ()
 
Matrix3setIdentity ()
 
T_Scalar getInverse (Matrix3 &dest) const
 
Matrix3 getInverse (T_Scalar *determinant=NULL) const
 
Matrix3invert (T_Scalar *determinant=NULL)
 
Matrix3rotate (T_Scalar degrees)
 
Matrix3translate (T_Scalar x, T_Scalar y)
 
Matrix3translate (const Vector2< T_Scalar > &v)
 
Matrix3scale (T_Scalar x, T_Scalar y)
 
Matrix3scale (const Vector2< T_Scalar > &v)
 
Matrix3postMultiply (const Matrix3 &m)
 
Matrix3preMultiply (const Matrix3 &m)
 
const T_Scalar & e (int i, int j) const
 
T_Scalar & e (int i, int j)
 

Static Public Member Functions

static Matrix3getNull (Matrix3 &out)
 
static Matrix3 getNull ()
 
static Matrix3 getIdentity ()
 
static Matrix3getIdentity (Matrix3 &out)
 
static Matrix3 getRotation (T_Scalar degrees)
 
static Matrix3getTranslation (Matrix3 &out, const Vector2< T_Scalar > &v)
 
static Matrix3 getTranslation (const Vector2< T_Scalar > &v)
 
static Matrix3 getTranslation (T_Scalar x, T_Scalar y)
 
static Matrix3getTranslation (Matrix3 &out, T_Scalar x, T_Scalar y)
 
static Matrix3getScaling (Matrix3 &out, const Vector2< T_Scalar > &v)
 
static Matrix3 getScaling (const Vector2< T_Scalar > &v)
 
static Matrix3 getScaling (T_Scalar x, T_Scalar y)
 
static Matrix3getScaling (Matrix3 &out, T_Scalar x, T_Scalar y)
 
static Matrix3multiply (Matrix3 &out, const Matrix3 &p, const Matrix3 &q)
 

Protected Attributes

Vector3< T_Scalar > mVec [3]
 

Detailed Description

template<typename T_Scalar>
class vl::Matrix3< T_Scalar >

The Matrix3 class is a template class that implements a generic 3x3 matrix, see also vl::dmat3, vl::fmat3, vl::umat3, vl::imat3.

See also
Vector4, Vector3, Vector2, Matrix4, Matrix2

Definition at line 48 of file Matrix3.hpp.

Member Typedef Documentation

◆ scalar_type

template<typename T_Scalar>
typedef T_Scalar vl::Matrix3< T_Scalar >::scalar_type

Definition at line 51 of file Matrix3.hpp.

Constructor & Destructor Documentation

◆ Matrix3() [1/4]

template<typename T_Scalar>
template<typename T >
vl::Matrix3< T_Scalar >::Matrix3 ( const Matrix3< T > &  m)
inlineexplicit

Definition at line 54 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ Matrix3() [2/4]

template<typename T_Scalar>
vl::Matrix3< T_Scalar >::Matrix3 ( )
inline

◆ Matrix3() [3/4]

template<typename T_Scalar>
vl::Matrix3< T_Scalar >::Matrix3 ( T_Scalar  n)
inlineexplicit

◆ Matrix3() [4/4]

template<typename T_Scalar>
vl::Matrix3< T_Scalar >::Matrix3 ( T_Scalar  e00,
T_Scalar  e01,
T_Scalar  e02,
T_Scalar  e10,
T_Scalar  e11,
T_Scalar  e12,
T_Scalar  e20,
T_Scalar  e21,
T_Scalar  e22 
)
inlineexplicit

Definition at line 72 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

Member Function Documentation

◆ diff()

template<typename T_Scalar>
T_Scalar vl::Matrix3< T_Scalar >::diff ( const Matrix3< T_Scalar > &  other) const
inline

Definition at line 89 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ e() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Matrix3< T_Scalar >::e ( int  i,
int  j 
) const
inline

◆ e() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Matrix3< T_Scalar >::e ( int  i,
int  j 
)
inline

Definition at line 518 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::mVec, and VL_CHECK.

◆ fill()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::fill ( T_Scalar  val)
inline

◆ get2x2()

template<typename T_Scalar>
Matrix2<T_Scalar> vl::Matrix3< T_Scalar >::get2x2 ( ) const
inline

Definition at line 286 of file Matrix3.hpp.

References vl::Matrix2< T_Scalar >::e(), and vl::Matrix3< T_Scalar >::e().

◆ getIdentity() [1/2]

template<typename T_Scalar>
static Matrix3 vl::Matrix3< T_Scalar >::getIdentity ( )
inlinestatic

Definition at line 379 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::Matrix3().

◆ getIdentity() [2/2]

template<typename T_Scalar>
static Matrix3& vl::Matrix3< T_Scalar >::getIdentity ( Matrix3< T_Scalar > &  out)
inlinestatic

◆ getInverse() [1/2]

template<typename T_Scalar >
T_Scalar vl::Matrix3< T_Scalar >::getInverse ( Matrix3< T_Scalar > &  dest) const

◆ getInverse() [2/2]

template<typename T_Scalar>
Matrix3 vl::Matrix3< T_Scalar >::getInverse ( T_Scalar *  determinant = NULL) const
inline

Definition at line 392 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::getInverse().

◆ getNull() [1/2]

template<typename T_Scalar>
static Matrix3& vl::Matrix3< T_Scalar >::getNull ( Matrix3< T_Scalar > &  out)
inlinestatic

Definition at line 356 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::fill().

◆ getNull() [2/2]

template<typename T_Scalar>
static Matrix3 vl::Matrix3< T_Scalar >::getNull ( )
inlinestatic

Definition at line 362 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::Matrix3().

◆ getRotation()

template<typename T_Scalar >
Matrix3< T_Scalar > vl::Matrix3< T_Scalar >::getRotation ( T_Scalar  degrees)
static

◆ getScaling() [1/4]

template<typename T_Scalar>
static Matrix3& vl::Matrix3< T_Scalar >::getScaling ( Matrix3< T_Scalar > &  out,
const Vector2< T_Scalar > &  v 
)
inlinestatic

◆ getScaling() [2/4]

template<typename T_Scalar>
static Matrix3 vl::Matrix3< T_Scalar >::getScaling ( const Vector2< T_Scalar > &  v)
inlinestatic

◆ getScaling() [3/4]

template<typename T_Scalar>
static Matrix3 vl::Matrix3< T_Scalar >::getScaling ( T_Scalar  x,
T_Scalar  y 
)
inlinestatic

Definition at line 461 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::getScaling().

◆ getScaling() [4/4]

template<typename T_Scalar>
static Matrix3& vl::Matrix3< T_Scalar >::getScaling ( Matrix3< T_Scalar > &  out,
T_Scalar  x,
T_Scalar  y 
)
inlinestatic

◆ getT()

template<typename T_Scalar>
Vector2<T_Scalar> vl::Matrix3< T_Scalar >::getT ( ) const
inline

◆ getTranslation() [1/4]

template<typename T_Scalar>
static Matrix3& vl::Matrix3< T_Scalar >::getTranslation ( Matrix3< T_Scalar > &  out,
const Vector2< T_Scalar > &  v 
)
inlinestatic

◆ getTranslation() [2/4]

template<typename T_Scalar>
static Matrix3 vl::Matrix3< T_Scalar >::getTranslation ( const Vector2< T_Scalar > &  v)
inlinestatic

◆ getTranslation() [3/4]

template<typename T_Scalar>
static Matrix3 vl::Matrix3< T_Scalar >::getTranslation ( T_Scalar  x,
T_Scalar  y 
)
inlinestatic

Definition at line 426 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::getTranslation().

◆ getTranslation() [4/4]

template<typename T_Scalar>
static Matrix3& vl::Matrix3< T_Scalar >::getTranslation ( Matrix3< T_Scalar > &  out,
T_Scalar  x,
T_Scalar  y 
)
inlinestatic

◆ getTransposed() [1/2]

template<typename T_Scalar>
Matrix3 vl::Matrix3< T_Scalar >::getTransposed ( ) const
inline

Definition at line 324 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ getTransposed() [2/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::getTransposed ( Matrix3< T_Scalar > &  dest) const
inline

Definition at line 333 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ getX()

template<typename T_Scalar>
Vector2<T_Scalar> vl::Matrix3< T_Scalar >::getX ( ) const
inline

◆ getY()

template<typename T_Scalar>
Vector2<T_Scalar> vl::Matrix3< T_Scalar >::getY ( ) const
inline

◆ invert()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::invert ( T_Scalar *  determinant = NULL)
inline

◆ isIdentity()

template<typename T_Scalar>
bool vl::Matrix3< T_Scalar >::isIdentity ( ) const
inline

Definition at line 280 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::ptr().

◆ isNull()

template<typename T_Scalar>
bool vl::Matrix3< T_Scalar >::isNull ( ) const
inline

Definition at line 341 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::mVec.

◆ multiply()

template<typename T_Scalar>
static Matrix3& vl::Matrix3< T_Scalar >::multiply ( Matrix3< T_Scalar > &  out,
const Matrix3< T_Scalar > &  p,
const Matrix3< T_Scalar > &  q 
)
inlinestatic

◆ operator!=()

template<typename T_Scalar>
bool vl::Matrix3< T_Scalar >::operator!= ( const Matrix3< T_Scalar > &  m) const
inline

Definition at line 151 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::operator==().

◆ operator*()

template<typename T_Scalar>
Matrix3 vl::Matrix3< T_Scalar >::operator* ( T_Scalar  d) const
inline

Definition at line 244 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator*=() [1/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::operator*= ( const Matrix3< T_Scalar > &  m)
inline

Definition at line 196 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::postMultiply().

◆ operator*=() [2/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::operator*= ( T_Scalar  d)
inline

Definition at line 253 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator+() [1/2]

template<typename T_Scalar>
Matrix3 vl::Matrix3< T_Scalar >::operator+ ( const Matrix3< T_Scalar > &  m) const
inline

Definition at line 162 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator+() [2/2]

template<typename T_Scalar>
Matrix3 vl::Matrix3< T_Scalar >::operator+ ( T_Scalar  d) const
inline

Definition at line 210 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator+=() [1/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::operator+= ( const Matrix3< T_Scalar > &  m)
inline

Definition at line 171 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator+=() [2/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::operator+= ( T_Scalar  d)
inline

Definition at line 219 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator-() [1/3]

template<typename T_Scalar>
Matrix3 vl::Matrix3< T_Scalar >::operator- ( const Matrix3< T_Scalar > &  m) const
inline

Definition at line 179 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator-() [2/3]

template<typename T_Scalar>
Matrix3 vl::Matrix3< T_Scalar >::operator- ( ) const
inline

Definition at line 201 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator-() [3/3]

template<typename T_Scalar>
Matrix3 vl::Matrix3< T_Scalar >::operator- ( T_Scalar  d) const
inline

Definition at line 227 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator-=() [1/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::operator-= ( const Matrix3< T_Scalar > &  m)
inline

Definition at line 188 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator-=() [2/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::operator-= ( T_Scalar  d)
inline

Definition at line 236 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator/()

template<typename T_Scalar>
Matrix3 vl::Matrix3< T_Scalar >::operator/ ( T_Scalar  d) const
inline

Definition at line 261 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator/=()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::operator/= ( T_Scalar  d)
inline

Definition at line 271 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ operator=()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::operator= ( const Matrix3< T_Scalar > &  m)
inline

Definition at line 156 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::mVec.

◆ operator==()

template<typename T_Scalar>
bool vl::Matrix3< T_Scalar >::operator== ( const Matrix3< T_Scalar > &  m) const
inline

Definition at line 146 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::mVec.

Referenced by vl::Matrix3< T_Scalar >::operator!=().

◆ postMultiply()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::postMultiply ( const Matrix3< T_Scalar > &  m)
inline

Definition at line 504 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::multiply().

Referenced by vl::Matrix3< T_Scalar >::operator*=().

◆ preMultiply()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::preMultiply ( const Matrix3< T_Scalar > &  m)
inline

◆ ptr() [1/2]

template<typename T_Scalar>
T_Scalar* vl::Matrix3< T_Scalar >::ptr ( )
inline

◆ ptr() [2/2]

template<typename T_Scalar>
const T_Scalar* vl::Matrix3< T_Scalar >::ptr ( ) const
inline

Definition at line 306 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

◆ rotate()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::rotate ( T_Scalar  degrees)
inline

◆ scale() [1/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::scale ( T_Scalar  x,
T_Scalar  y 
)
inline

◆ scale() [2/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::scale ( const Vector2< T_Scalar > &  v)
inline

◆ set2x2()

template<typename T_Scalar>
void vl::Matrix3< T_Scalar >::set2x2 ( const Matrix2< T_Scalar > &  m)
inline

This writes only on the upper 2x2 part of the matrix without touching the last row and column.

Definition at line 295 of file Matrix3.hpp.

References vl::Matrix2< T_Scalar >::e(), and vl::Matrix3< T_Scalar >::e().

◆ setIdentity()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::setIdentity ( )
inline

◆ setNull()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::setNull ( )
inline

Definition at line 350 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::fill().

◆ setT()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::setT ( const Vector2< T_Scalar > &  v)
inline

◆ setX()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::setX ( const Vector2< T_Scalar > &  v)
inline

◆ setY()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::setY ( const Vector2< T_Scalar > &  v)
inline

◆ translate() [1/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::translate ( T_Scalar  x,
T_Scalar  y 
)
inline

◆ translate() [2/2]

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::translate ( const Vector2< T_Scalar > &  v)
inline

◆ transpose()

template<typename T_Scalar>
Matrix3& vl::Matrix3< T_Scalar >::transpose ( )
inline

Definition at line 311 of file Matrix3.hpp.

References vl::Matrix3< T_Scalar >::e().

Member Data Documentation

◆ mVec

template<typename T_Scalar>
Vector3<T_Scalar> vl::Matrix3< T_Scalar >::mVec[3]
protected

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