CGVIS Utils
Loading...
Searching...
No Matches
Mat3t< T > Class Template Reference

#include <Mat3.h>

Public Member Functions

 Mat3t ()
 Construct the identity matrix.
 Mat3t (T m11, T m12, T m13, T m21, T m22, T m23, T m31, T m32, T m33)
 Construct from 9 elements (column-major order).
 Mat3t (const std::array< T, 9 > &e)
 Construct from a raw array of 9 elements.
 Mat3t (const Vec3t< T > &e1, const Vec3t< T > &e2, const Vec3t< T > &e3)
 Construct from three column vectors.
 Mat3t (const Mat3t &other)
 Copy-construct from another matrix.
const std::string toString () const
 String representation (pretty-printed rows).
 operator T* (void)
 Implicit conversion to raw pointer (non-const).
 operator const T * (void) const
 Implicit conversion to raw pointer (const).
Mat3t operator* (T scalar) const
 Component-wise multiplication by scalar.
Mat3t operator+ (T scalar) const
 Component-wise addition of scalar.
Mat3t operator- (T scalar) const
 Component-wise subtraction of scalar.
Mat3t operator/ (T scalar) const
 Component-wise division by scalar.
Mat3t operator* (const Mat3t &other) const
 Matrix–matrix product (column-major; standard linear algebra).
Vec3t< T > operator* (const Vec3t< T > &other) const
 Transform a 3D vector.

Static Public Member Functions

static Mat3t scaling (const Vec3t< T > &scale)
 Non-uniform scaling by components of scale.
static Mat3t scaling (T x, T y, T z)
 Non-uniform scaling by components.
static Mat3t rotationX (T degree)
 Rotation about the X-axis by degree (degrees).
static Mat3t rotationY (T degree)
 Rotation about the Y-axis by degree (degrees).
static Mat3t rotationZ (T degree)
 Rotation about the Z-axis by degree (degrees).
static Mat3t transpose (const Mat3t &m)
 Transpose of a 3×3 matrix.
static T det (const Mat3t &m)
 Determinant of a 3×3 matrix.
static Mat3t inverse (const Mat3t &m, T det)
 Matrix inverse with precomputed determinant.
static Mat3t inverse (const Mat3t &m)
 Matrix inverse computed via adjugate and determinant.

Friends

std::ostream & operator<< (std::ostream &os, const Mat3t &m)
 Stream insertion using toString().

Constructor & Destructor Documentation

◆ Mat3t() [1/5]

template<typename T>
Mat3t< T >::Mat3t ( )
inline

Construct the identity matrix.

◆ Mat3t() [2/5]

template<typename T>
Mat3t< T >::Mat3t ( T m11,
T m12,
T m13,
T m21,
T m22,
T m23,
T m31,
T m32,
T m33 )
inline

Construct from 9 elements (column-major order).

Parameters
m11..m33Elements of the matrix in column-major order.

◆ Mat3t() [3/5]

template<typename T>
Mat3t< T >::Mat3t ( const std::array< T, 9 > & e)
inline

Construct from a raw array of 9 elements.

Parameters
eArray in column-major order.

◆ Mat3t() [4/5]

template<typename T>
Mat3t< T >::Mat3t ( const Vec3t< T > & e1,
const Vec3t< T > & e2,
const Vec3t< T > & e3 )
inline

Construct from three column vectors.

Parameters
e1First column (x,y,z).
e2Second column (x,y,z).
e3Third column (x,y,z).

◆ Mat3t() [5/5]

template<typename T>
Mat3t< T >::Mat3t ( const Mat3t< T > & other)
inline

Copy-construct from another matrix.

Member Function Documentation

◆ det()

template<typename T>
T Mat3t< T >::det ( const Mat3t< T > & m)
inlinestatic

Determinant of a 3×3 matrix.

Here is the caller graph for this function:

◆ inverse() [1/2]

template<typename T>
Mat3t Mat3t< T >::inverse ( const Mat3t< T > & m)
inlinestatic

Matrix inverse computed via adjugate and determinant.

Parameters
mInput matrix.
Returns
Inverse of m (determinant computed internally).

◆ inverse() [2/2]

template<typename T>
Mat3t Mat3t< T >::inverse ( const Mat3t< T > & m,
T det )
inlinestatic

Matrix inverse with precomputed determinant.

Parameters
mInput matrix.
detDeterminant of m.
Returns
Inverse of m.
Warning
No zero-check is performed; caller must ensure det ≠ 0.
Here is the caller graph for this function:

◆ operator const T *()

template<typename T>
Mat3t< T >::operator const T * ( void ) const
inline

Implicit conversion to raw pointer (const).

Returns
Const pointer to the underlying e[0].

◆ operator T*()

template<typename T>
Mat3t< T >::operator T* ( void )
inline

Implicit conversion to raw pointer (non-const).

Returns
Pointer to the underlying e[0].
Warning
Exposes internal layout; use with care.

◆ operator*() [1/3]

template<typename T>
Mat3t Mat3t< T >::operator* ( const Mat3t< T > & other) const
inline

Matrix–matrix product (column-major; standard linear algebra).

◆ operator*() [2/3]

template<typename T>
Vec3t< T > Mat3t< T >::operator* ( const Vec3t< T > & other) const
inline

Transform a 3D vector.

◆ operator*() [3/3]

template<typename T>
Mat3t Mat3t< T >::operator* ( T scalar) const
inline

Component-wise multiplication by scalar.

◆ operator+()

template<typename T>
Mat3t Mat3t< T >::operator+ ( T scalar) const
inline

Component-wise addition of scalar.

◆ operator-()

template<typename T>
Mat3t Mat3t< T >::operator- ( T scalar) const
inline

Component-wise subtraction of scalar.

◆ operator/()

template<typename T>
Mat3t Mat3t< T >::operator/ ( T scalar) const
inline

Component-wise division by scalar.

◆ rotationX()

template<typename T>
Mat3t Mat3t< T >::rotationX ( T degree)
inlinestatic

Rotation about the X-axis by degree (degrees).

◆ rotationY()

template<typename T>
Mat3t Mat3t< T >::rotationY ( T degree)
inlinestatic

Rotation about the Y-axis by degree (degrees).

◆ rotationZ()

template<typename T>
Mat3t Mat3t< T >::rotationZ ( T degree)
inlinestatic

Rotation about the Z-axis by degree (degrees).

◆ scaling() [1/2]

template<typename T>
Mat3t Mat3t< T >::scaling ( const Vec3t< T > & scale)
inlinestatic

Non-uniform scaling by components of scale.

Here is the caller graph for this function:

◆ scaling() [2/2]

template<typename T>
Mat3t Mat3t< T >::scaling ( T x,
T y,
T z )
inlinestatic

Non-uniform scaling by components.

◆ toString()

template<typename T>
const std::string Mat3t< T >::toString ( ) const
inline

String representation (pretty-printed rows).

Returns
New string describing the matrix.
Here is the caller graph for this function:

◆ transpose()

template<typename T>
Mat3t Mat3t< T >::transpose ( const Mat3t< T > & m)
inlinestatic

Transpose of a 3×3 matrix.

◆ operator<<

template<typename T>
std::ostream & operator<< ( std::ostream & os,
const Mat3t< T > & m )
friend

Stream insertion using toString().


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