ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
active::geometry::Matrix4x4 Class Reference

A 4x4 matrix class. More...

#include <Matrix4x4.h>

Public Types

using row_t = std::array<double, 4>
 
using base_t = std::array<row_t, 4>
 
using Unique = std::unique_ptr<Matrix4x4>
 Unique pointer.
 
using Shared = std::shared_ptr<Matrix4x4>
 Shared pointer.
 
using Option = std::optional<Matrix4x4>
 Optional.
 

Public Member Functions

 Matrix4x4 ()
 
 Matrix4x4 (double a1, double b1, double c1, double d1, double a2, double b2, double c2, double d2, double a3, double b3, double c3, double d3, double a4, double b4, double c4, double d4)
 
Matrix4x4operator= (const Matrix4x4 &source)
 
bool operator== (const Matrix4x4 &ref) const
 
bool operator!= (const Matrix4x4 &ref) const
 
Matrix4x4 operator* (const Matrix4x4 &ref) const
 
Matrix4x4operator*= (const Matrix4x4 &ref)
 
row_t operator[] (unsigned short index)
 
double & operator() (unsigned short row, unsigned short col)
 
const double & operator() (unsigned short row, unsigned short col) const
 
Matrix4x4 getInverse () const
 
double getDeterminant () const
 

Static Public Member Functions

static Matrix4x4 createXRotate (const double &angle)
 
static Matrix4x4 createYRotate (const double &angle)
 
static Matrix4x4 createZRotate (const double &angle)
 
static Matrix4x4 createScale (const double &x, const double &y, const double &z)
 
static Matrix4x4 createTranslate (const double &x, const double &y, const double &z)
 
static Matrix4x4 createIdentity ()
 

Protected Member Functions

Matrix3x3 getSubmatrix (unsigned short row, unsigned short col) const
 

Detailed Description

A 4x4 matrix class.

Constructor & Destructor Documentation

◆ Matrix4x4() [1/2]

Matrix4x4::Matrix4x4 ( )

Constructor

Here is the caller graph for this function:

◆ Matrix4x4() [2/2]

Matrix4x4::Matrix4x4 ( double a1,
double b1,
double c1,
double d1,
double a2,
double b2,
double c2,
double d2,
double a3,
double b3,
double c3,
double d3,
double a4,
double b4,
double c4,
double d4 )

Constructor

Member Function Documentation

◆ createIdentity()

Matrix4x4 Matrix4x4::createIdentity ( )
static

Create an identity matrix

Returns
The requested identity matrix
Here is the caller graph for this function:

◆ createScale()

Matrix4x4 Matrix4x4::createScale ( const double & x,
const double & y,
const double & z )
static

Create a scaling matrix

Parameters
xThe scale in the x axis
yThe scale in the y axis
zThe scale in the z axis
Returns
The requested scaling matrix

◆ createTranslate()

Matrix4x4 Matrix4x4::createTranslate ( const double & x,
const double & y,
const double & z )
static

Create a translation matrix

Parameters
xThe offset in the x axis
yThe offset in the y axis
zThe offset in the z axis
Returns
The requested transformation matrix

◆ createXRotate()

Matrix4x4 Matrix4x4::createXRotate ( const double & angle)
static

Create a rotation matrix about the x axis

Parameters
angleThe rotation angle
Returns
The requested rotation matrix
Here is the call graph for this function:

◆ createYRotate()

Matrix4x4 Matrix4x4::createYRotate ( const double & angle)
static

Create a rotation matrix about the y axis

Parameters
angleThe rotation angle
Returns
The requested rotation matrix
Here is the call graph for this function:

◆ createZRotate()

Matrix4x4 Matrix4x4::createZRotate ( const double & angle)
static

Create a rotation matrix about the z axis

Parameters
angleThe rotation angle
Returns
The requested rotation matrix
Here is the call graph for this function:

◆ getDeterminant()

double Matrix4x4::getDeterminant ( ) const

Get the determinant

Returns
The matrix determinant
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInverse()

Matrix4x4 Matrix4x4::getInverse ( ) const

Get the inverse matrix (or identity if none exists)

Returns
An inverse matrix
Here is the call graph for this function:

◆ getSubmatrix()

Matrix3x3 Matrix4x4::getSubmatrix ( unsigned short row,
unsigned short col ) const
protected

Get the requested submatrix

Parameters
rowRow position
colColumn position
Returns
The requested submatrix
Here is the caller graph for this function:

◆ operator!=()

bool Matrix4x4::operator!= ( const Matrix4x4 & ref) const

Inequality operator

Parameters
refThe object to compare
Returns
True if the objects are not identical

◆ operator()() [1/2]

double & active::geometry::Matrix4x4::operator() ( unsigned short row,
unsigned short col )
inline

Checked subscript method

Parameters
rowThe required row
colThe required column
Returns
The value at the specified position

◆ operator()() [2/2]

const double & active::geometry::Matrix4x4::operator() ( unsigned short row,
unsigned short col ) const
inline

Checked subscript method

Parameters
rowThe required row
colThe required column
Returns
The value at the specified position

◆ operator*()

Matrix4x4 Matrix4x4::operator* ( const Matrix4x4 & ref) const

Multiplication operator

Parameters
refThe matrix to multiply this by
Returns
The result

◆ operator*=()

Matrix4x4 & Matrix4x4::operator*= ( const Matrix4x4 & ref)

Multiplication with assignment operator

Parameters
refThe matrix to multiply this by
Returns
A reference to this

◆ operator=()

Matrix4x4 & Matrix4x4::operator= ( const Matrix4x4 & source)

Assignment operator

Parameters
sourceThe object to copy
Returns
A reference to this

◆ operator==()

bool Matrix4x4::operator== ( const Matrix4x4 & ref) const

Equality operator

Parameters
refThe object to compare
Returns
True if the objects are identical
Here is the call graph for this function:

◆ operator[]()

row_t active::geometry::Matrix4x4::operator[] ( unsigned short index)
inline

Unchecked subscript method

Parameters
indexAn index into the matrix
Returns
The value at the specified index

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