ReactPhysics3D  v0.10.2
C++ Physics engine library
Loading...
Searching...
No Matches
reactphysics3d::Matrix2x2 Class Reference

This class represents a 2x2 matrix. More...

#include <include/reactphysics3d/mathematics/Matrix2x2.h>

Public Member Functions

 Matrix2x2 ()
 Constructor.
 
 Matrix2x2 (decimal value)
 Constructor.
 
 Matrix2x2 (decimal a1, decimal a2, decimal b1, decimal b2)
 Constructor.
 
void setAllValues (decimal a1, decimal a2, decimal b1, decimal b2)
 Set all the values in the matrix.
 
void setToZero ()
 Set the matrix to zero.
 
Vector2 getColumn (int i) const
 Return a column.
 
Vector2 getRow (int i) const
 Return a row.
 
Matrix2x2 getTranspose () const
 Return the transpose matrix.
 
decimal getDeterminant () const
 Return the determinant of the matrix.
 
decimal getTrace () const
 Return the trace of the matrix.
 
Matrix2x2 getInverse () const
 Return the inverse matrix.
 
Matrix2x2 getInverse (decimal determinant) const
 Return the inverse matrix.
 
Matrix2x2 getAbsoluteMatrix () const
 Return the matrix with absolute values.
 
void setToIdentity ()
 Set the matrix to the identity matrix.
 
bool operator== (const Matrix2x2 &matrix) const
 Overloaded operator for equality condition.
 
bool operator!= (const Matrix2x2 &matrix) const
 Overloaded operator for the is different condition.
 
Matrix2x2operator+= (const Matrix2x2 &matrix)
 Overloaded operator for addition with assignment.
 
Matrix2x2operator-= (const Matrix2x2 &matrix)
 Overloaded operator for substraction with assignment.
 
Matrix2x2operator*= (decimal nb)
 Overloaded operator for multiplication with a number with assignment.
 
const Vector2operator[] (int row) const
 Overloaded operator to read element of the matrix.
 
Vector2operator[] (int row)
 Overloaded operator to read/write element of the matrix.
 
std::string to_string () const
 Return the string representation.
 

Static Public Member Functions

static Matrix2x2 identity ()
 Return the 2x2 identity matrix.
 
static Matrix2x2 zero ()
 Return the 2x2 zero matrix.
 

Detailed Description

This class represents a 2x2 matrix.

Member Function Documentation

◆ operator[]() [1/2]

RP3D_FORCE_INLINE Vector2 & reactphysics3d::Matrix2x2::operator[] ( int  row)

Overloaded operator to read/write element of the matrix.

This operator is also used to access a matrix value using the syntax matrix[row][col].

◆ operator[]() [2/2]

RP3D_FORCE_INLINE const Vector2 & reactphysics3d::Matrix2x2::operator[] ( int  row) const

Overloaded operator to read element of the matrix.

This operator is also used to access a matrix value using the syntax matrix[row][col].


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