clan::Mat3< Type > Class Template Reference

3D matrix More...

#include <mat2.h>

Public Member Functions

Operations
double det () const
 Calculate the matrix determinant. More...
 
Mat3< Type > & adjoint ()
 Creates the adjoint (or known as adjugate) of the matrix. More...
 
Mat3< Type > & inverse ()
 Create the matrix inverse. (Returns a zero matrix if the determinent = 0) More...
 
Mat3< Type > & transpose ()
 Calculate the transpose of this matrix. More...
 
bool is_equal (const Mat3< Type > &other, Type epsilon) const
 Returns true if equal within the bounds of an epsilon. More...
 
Operators
 operator Type const * () const
 Operator that returns the matrix as a array. More...
 
 operator Type * ()
 Operator that returns the matrix as a array. More...
 
Type & operator[] (int i)
 Operator that returns the matrix cell at the given index. More...
 
const Type & operator[] (int i) const
 Operator that returns the matrix cell at the given index. More...
 
Type & operator[] (unsigned int i)
 Operator that returns the matrix cell at the given index. More...
 
const Type & operator[] (unsigned int i) const
 Operator that returns the matrix cell at the given index. More...
 
Mat3< Type > & operator= (const Mat3< Type > &copy)
 Copy assignment operator. More...
 
Mat3< Type > & operator= (const Mat4< Type > &copy)
 Copy assignment operator. More...
 
Mat3< Type > & operator= (const Mat2< Type > &copy)
 Copy assignment operator. More...
 
Mat3< Type > operator* (const Mat3< Type > &mult) const
 Multiplication operator. More...
 
Mat3< Type > operator+ (const Mat3< Type > &add_matrix) const
 Addition operator. More...
 
Mat3< Type > operator- (const Mat3< Type > &sub_matrix) const
 Subtraction operator. More...
 
Vec2< Type > operator* (const Vec2< Type > &mult) const
 Multiplication operator. More...
 
bool operator== (const Mat3< Type > &other) const
 Equality operator. More...
 
bool operator!= (const Mat3< Type > &other)
 Not-equal operator. More...
 

Public Attributes

Attributes
Type matrix [9]
 

Construction

 Mat3 ()
 Constructs a 3x3 matrix (zero'ed) More...
 
 Mat3 (const Mat3< Type > &copy)
 Constructs a 3x3 matrix (copied) More...
 
 Mat3 (const Mat2< Type > &copy)
 Constructs a 3x3 matrix (copied from a 2d matrix) More...
 
 Mat3 (const Mat4< Type > &copy)
 Constructs a 3x3 matrix (copied from a 4d matrix) More...
 
 Mat3 (const float *init_matrix)
 Constructs a 3x3 matrix (copied from 9 floats) More...
 
 Mat3 (Type m00, Type m01, Type m02, Type m10, Type m11, Type m12, Type m20, Type m21, Type m22)
 Constructs a 3x3 matrix (copied from specified values) More...
 
 Mat3 (const double *init_matrix)
 Constructs a 3x3 matrix (copied from 9 doubles) More...
 
 Mat3 (const int64_t *init_matrix)
 Constructs a 3x3 matrix (copied from 9, 64 bit integers) More...
 
 Mat3 (const int32_t *init_matrix)
 Constructs a 3x3 matrix (copied from 9, 32 bit integers) More...
 
 Mat3 (const int16_t *init_matrix)
 Constructs a 3x3 matrix (copied from 9, 16 bit integers) More...
 
 Mat3 (const int8_t *init_matrix)
 Constructs a 3x3 matrix (copied from 9, 8 bit integers) More...
 
static Mat3< Type > null ()
 
static Mat3< Type > identity ()
 
static Mat3< Type > rotate (const Angle &angle, Type x, Type y, Type z, bool normalize=true)
 Create a 3d rotation matrix. More...
 
static Mat3< Type > rotate (const Angle &angle, Vec3< Type > rotation, bool normalize=true)
 Create a 3d rotation matrix. More...
 
static Mat3< Type > rotate (const Angle &angle_x, const Angle &angle_y, const Angle &angle_z, EulerOrder order)
 Create a 3d rotation matrix using euler angles. More...
 
static Mat3< Type > rotate (const Angle &angle)
 Create a 2d rotation matrix. More...
 
static Mat3< Type > scale (Type x, Type y)
 Create a 2d scale matrix. More...
 
static Mat3< Type > scale (const Vec3< Type > &xy)
 Create a 2d scale matrix. More...
 
static Mat3< Type > translate (Type x, Type y)
 Create a 2d translation matrix. More...
 
static Mat3< Type > translate (const Vec2< Type > &xy)
 Create a 2d translation matrix. More...
 
static Mat3< Type > multiply (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
 Multiply 2 matrices. More...
 
static Mat3< Type > add (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
 Add 2 matrices. More...
 
static Mat3< Type > subtract (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
 Subtract 2 matrices. More...
 
static Mat3< Type > adjoint (const Mat3< Type > &matrix)
 Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix. More...
 
static Mat3< Type > inverse (const Mat3< Type > &matrix)
 Calculate the matrix inverse of a matrix. More...
 
static Mat3< Type > transpose (const Mat3< Type > &matrix)
 Calculate the transpose of a matrix. More...
 
static bool is_equal (const Mat3< Type > &first, const Mat3< Type > &second, Type epsilon)
 Returns true if equal within the bounds of an epsilon. More...
 

Detailed Description

template<typename Type>
class clan::Mat3< Type >

3D matrix

These matrix templates are defined for: int (Mat3i), float (Mat3f), double (Mat3d)


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