Public Member Functions | Public Attributes | Friends | List of all members
Matrix3x3 Class Reference

#include <IceMatrix3x3.h>

Public Member Functions

inline_ void Add (const Matrix3x3 &mat)
 Add another matrix. More...
 
inline_ void Add (const Matrix3x3 &a, const Matrix3x3 &b)
 
inline_ void Copy (const Matrix3x3 &source)
 Copy from a Matrix3x3. More...
 
float Determinant () const
 Compute the determinant of the matrix. We use the rule of Sarrus. More...
 
Matrix3x3Exp (const Matrix3x3 &a)
 this = exp(a) More...
 
void FromQuat (const Quat &q)
 
void FromQuatL2 (const Quat &q, float l2)
 
Matrix3x3FromTo (const Point &from, const Point &to)
 Makes a rotation matrix mapping vector "from" to vector "to". More...
 
inline_ void GetCol (const udword c, Point &p) const
 Returns a column. More...
 
inline_ void GetRow (const udword r, Point &p) const
 Returns a row. More...
 
inline_ const PointGetRow (const udword r) const
 Returns a row. More...
 
inline_ PointGetRow (const udword r)
 Returns a row. More...
 
inline_ void Identity ()
 Sets the identity matrix. More...
 
Matrix3x3Invert ()
 Invert the matrix. Determinant must be different from zero, else matrix can't be inverted. More...
 
inline_ bool IsIdentity () const
 Checks for identity. More...
 
inline_ BOOL IsValid () const
 Checks matrix validity. More...
 
inline_ void Mac (const Matrix3x3 &a, const Matrix3x3 &b, float s)
 Mac. More...
 
inline_ void Mac (const Matrix3x3 &a, float s)
 Mac. More...
 
inline_ Matrix3x3 ()
 Empty constructor. More...
 
inline_ Matrix3x3 (float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
 Constructor from 9 values. More...
 
inline_ Matrix3x3 (const Matrix3x3 &mat)
 Copy constructor. More...
 
inline_ void Mult (const Matrix3x3 &a, float s)
 this = A * s More...
 
inline_ void Mult (const Matrix3x3 &a, const Matrix3x3 &b)
 this = a * b More...
 
inline_ void MultABt (const Matrix3x3 &a, const Matrix3x3 &b)
 this = a * transpose(b) More...
 
inline_ void MultAtB (const Matrix3x3 &a, const Matrix3x3 &b)
 this = transpose(a) * b More...
 
inline_ void Neg ()
 Negates the matrix. More...
 
inline_ void Neg (const Matrix3x3 &mat)
 Neg from another matrix. More...
 
Matrix3x3Normalize ()
 
 operator Matrix4x4 () const
 Cast a Matrix3x3 to a Matrix4x4. More...
 
 operator Quat () const
 Cast a Matrix3x3 to a Quat. More...
 
inline_ Matrix3x3 operator* (const Matrix3x3 &mat) const
 Operator for Matrix3x3 Mul = Matrix3x3 * Matrix3x3;. More...
 
inline_ Point operator* (const Point &v) const
 Operator for Point Mul = Matrix3x3 * Point;. More...
 
inline_ Matrix3x3 operator* (float s) const
 Operator for Matrix3x3 Mul = Matrix3x3 * float;. More...
 
inline_ Matrix3x3operator*= (const Matrix3x3 &mat)
 Operator for Matrix3x3 *= Matrix3x3. More...
 
inline_ Matrix3x3operator*= (float s)
 Operator for Matrix3x3 *= float. More...
 
inline_ Matrix3x3 operator+ (const Matrix3x3 &mat) const
 Operator for Matrix3x3 Plus = Matrix3x3 + Matrix3x3;. More...
 
inline_ Matrix3x3operator+= (const Matrix3x3 &mat)
 Operator for Matrix3x3 += Matrix3x3. More...
 
inline_ Matrix3x3 operator- (const Matrix3x3 &mat) const
 Operator for Matrix3x3 Minus = Matrix3x3 - Matrix3x3;. More...
 
inline_ Matrix3x3operator-= (const Matrix3x3 &mat)
 Operator for Matrix3x3 -= Matrix3x3. More...
 
inline_ Matrix3x3 operator/ (float s) const
 Operator for Matrix3x3 Div = Matrix3x3 / float;. More...
 
inline_ Matrix3x3operator/= (float s)
 Operator for Matrix3x3 /= float. More...
 
inline_ const Pointoperator[] (int row) const
 
inline_ Pointoperator[] (int row)
 
Matrix3x3Rot (float angle, const Point &axis)
 Make a rotation matrix about an arbitrary axis. More...
 
void RotX (float angle)
 
void RotY (float angle)
 
void RotYX (float y, float x)
 
void RotZ (float angle)
 
inline_ void Scale (const Point &p)
 Scales from a Point. Each row is multiplied by a component. More...
 
inline_ void Scale (float sx, float sy, float sz)
 Scales from floats. Each row is multiplied by a value. More...
 
inline_ void Set (float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
 Assign values. More...
 
inline_ void SetCol (const udword c, const Point &p)
 Sets a column. More...
 
inline_ void SetRow (const udword r, const Point &p)
 Sets a row. More...
 
inline_ void SetScale (const Point &p)
 Sets the scale from a Point. The point is put on the diagonal. More...
 
inline_ void SetScale (float sx, float sy, float sz)
 Sets the scale from floats. Values are put on the diagonal. More...
 
inline_ void SkewSymmetric (const Point &a)
 
inline_ void Sub (const Matrix3x3 &mat)
 Sub another matrix. More...
 
inline_ void Sub (const Matrix3x3 &a, const Matrix3x3 &b)
 
inline_ float Trace () const
 Computes the trace. The trace is the sum of the 3 diagonal components. More...
 
void Transpose ()
 Transpose the matrix. More...
 
void Transpose (const Matrix3x3 &a)
 this = Transpose(a) More...
 
inline_ void Zero ()
 Clears the matrix. More...
 
inline_ ~Matrix3x3 ()
 Destructor. More...
 

Public Attributes

float m [3][3]
 

Friends

inline_ friend Matrix3x3 operator* (float s, const Matrix3x3 &mat)
 Operator for Matrix3x3 Mul = float * Matrix3x3;. More...
 
inline_ friend Matrix3x3 operator/ (float s, const Matrix3x3 &mat)
 Operator for Matrix3x3 Div = float / Matrix3x3;. More...
 

Detailed Description

3x3 matrix. DirectX-compliant, ie row-column order, ie m[Row][Col]. Same as: m11 m12 m13 first row. m21 m22 m23 second row. m31 m32 m33 third row. Stored in memory as m11 m12 m13 m21...

Multiplication rules:

[x'y'z'] = [xyz][M]

x' = x*m11 + y*m21 + z*m31 y' = x*m12 + y*m22 + z*m32 z' = x*m13 + y*m23 + z*m33

Author
Pierre Terdiman
Version
1.0

Definition at line 20 of file IceMatrix3x3.h.

Constructor & Destructor Documentation

◆ Matrix3x3() [1/3]

inline_ Matrix3x3::Matrix3x3 ( )
inline

Empty constructor.

Definition at line 24 of file IceMatrix3x3.h.

◆ Matrix3x3() [2/3]

inline_ Matrix3x3::Matrix3x3 ( float  m00,
float  m01,
float  m02,
float  m10,
float  m11,
float  m12,
float  m20,
float  m21,
float  m22 
)
inline

Constructor from 9 values.

Definition at line 26 of file IceMatrix3x3.h.

◆ Matrix3x3() [3/3]

inline_ Matrix3x3::Matrix3x3 ( const Matrix3x3 mat)
inline

Copy constructor.

Definition at line 33 of file IceMatrix3x3.h.

◆ ~Matrix3x3()

inline_ Matrix3x3::~Matrix3x3 ( )
inline

Destructor.

Definition at line 35 of file IceMatrix3x3.h.

Member Function Documentation

◆ Add() [1/2]

inline_ void Matrix3x3::Add ( const Matrix3x3 mat)
inline

Add another matrix.

Definition at line 159 of file IceMatrix3x3.h.

◆ Add() [2/2]

inline_ void Matrix3x3::Add ( const Matrix3x3 a,
const Matrix3x3 b 
)
inline

Definition at line 204 of file IceMatrix3x3.h.

◆ Copy()

inline_ void Matrix3x3::Copy ( const Matrix3x3 source)
inline

Copy from a Matrix3x3.

Definition at line 68 of file IceMatrix3x3.h.

◆ Determinant()

float Matrix3x3::Determinant ( ) const
inline

Compute the determinant of the matrix. We use the rule of Sarrus.

Definition at line 303 of file IceMatrix3x3.h.

◆ Exp()

Matrix3x3& Matrix3x3::Exp ( const Matrix3x3 a)

this = exp(a)

◆ FromQuat()

void Matrix3x3::FromQuat ( const Quat &  q)

◆ FromQuatL2()

void Matrix3x3::FromQuatL2 ( const Quat &  q,
float  l2 
)

◆ FromTo()

Matrix3x3& Matrix3x3::FromTo ( const Point from,
const Point to 
)

Makes a rotation matrix mapping vector "from" to vector "to".

◆ GetCol()

inline_ void Matrix3x3::GetCol ( const udword  c,
Point p 
) const
inline

Returns a column.

Definition at line 80 of file IceMatrix3x3.h.

◆ GetRow() [1/3]

inline_ void Matrix3x3::GetRow ( const udword  r,
Point p 
) const
inline

Returns a row.

Definition at line 72 of file IceMatrix3x3.h.

◆ GetRow() [2/3]

inline_ const Point& Matrix3x3::GetRow ( const udword  r) const
inline

Returns a row.

Definition at line 74 of file IceMatrix3x3.h.

◆ GetRow() [3/3]

inline_ Point& Matrix3x3::GetRow ( const udword  r)
inline

Returns a row.

Definition at line 76 of file IceMatrix3x3.h.

◆ Identity()

inline_ void Matrix3x3::Identity ( )
inline

Sets the identity matrix.

Definition at line 89 of file IceMatrix3x3.h.

◆ Invert()

Matrix3x3& Matrix3x3::Invert ( )
inline

Invert the matrix. Determinant must be different from zero, else matrix can't be inverted.

Definition at line 317 of file IceMatrix3x3.h.

◆ IsIdentity()

inline_ bool Matrix3x3::IsIdentity ( ) const
inline

Checks for identity.

Definition at line 91 of file IceMatrix3x3.h.

◆ IsValid()

inline_ BOOL Matrix3x3::IsValid ( ) const
inline

Checks matrix validity.

Definition at line 109 of file IceMatrix3x3.h.

◆ Mac() [1/2]

inline_ void Matrix3x3::Mac ( const Matrix3x3 a,
const Matrix3x3 b,
float  s 
)
inline

Mac.

Definition at line 174 of file IceMatrix3x3.h.

◆ Mac() [2/2]

inline_ void Matrix3x3::Mac ( const Matrix3x3 a,
float  s 
)
inline

Mac.

Definition at line 189 of file IceMatrix3x3.h.

◆ Mult() [1/2]

inline_ void Matrix3x3::Mult ( const Matrix3x3 a,
float  s 
)
inline

this = A * s

Definition at line 197 of file IceMatrix3x3.h.

◆ Mult() [2/2]

inline_ void Matrix3x3::Mult ( const Matrix3x3 a,
const Matrix3x3 b 
)
inline

this = a * b

Definition at line 219 of file IceMatrix3x3.h.

◆ MultABt()

inline_ void Matrix3x3::MultABt ( const Matrix3x3 a,
const Matrix3x3 b 
)
inline

this = a * transpose(b)

Definition at line 247 of file IceMatrix3x3.h.

◆ MultAtB()

inline_ void Matrix3x3::MultAtB ( const Matrix3x3 a,
const Matrix3x3 b 
)
inline

this = transpose(a) * b

Definition at line 233 of file IceMatrix3x3.h.

◆ Neg() [1/2]

inline_ void Matrix3x3::Neg ( )
inline

Negates the matrix.

Definition at line 143 of file IceMatrix3x3.h.

◆ Neg() [2/2]

inline_ void Matrix3x3::Neg ( const Matrix3x3 mat)
inline

Neg from another matrix.

Definition at line 151 of file IceMatrix3x3.h.

◆ Normalize()

Matrix3x3& Matrix3x3::Normalize ( )

◆ operator Matrix4x4()

Matrix3x3::operator Matrix4x4 ( ) const

Cast a Matrix3x3 to a Matrix4x4.

◆ operator Quat()

Matrix3x3::operator Quat ( ) const

Cast a Matrix3x3 to a Quat.

◆ operator*() [1/3]

inline_ Matrix3x3 Matrix3x3::operator* ( const Matrix3x3 mat) const
inline

Operator for Matrix3x3 Mul = Matrix3x3 * Matrix3x3;.

Definition at line 366 of file IceMatrix3x3.h.

◆ operator*() [2/3]

inline_ Point Matrix3x3::operator* ( const Point v) const
inline

Operator for Point Mul = Matrix3x3 * Point;.

Definition at line 383 of file IceMatrix3x3.h.

◆ operator*() [3/3]

inline_ Matrix3x3 Matrix3x3::operator* ( float  s) const
inline

Operator for Matrix3x3 Mul = Matrix3x3 * float;.

Definition at line 386 of file IceMatrix3x3.h.

◆ operator*=() [1/2]

inline_ Matrix3x3& Matrix3x3::operator*= ( const Matrix3x3 mat)
inline

Operator for Matrix3x3 *= Matrix3x3.

Definition at line 441 of file IceMatrix3x3.h.

◆ operator*=() [2/2]

inline_ Matrix3x3& Matrix3x3::operator*= ( float  s)
inline

Operator for Matrix3x3 *= float.

Definition at line 463 of file IceMatrix3x3.h.

◆ operator+()

inline_ Matrix3x3 Matrix3x3::operator+ ( const Matrix3x3 mat) const
inline

Operator for Matrix3x3 Plus = Matrix3x3 + Matrix3x3;.

Definition at line 348 of file IceMatrix3x3.h.

◆ operator+=()

inline_ Matrix3x3& Matrix3x3::operator+= ( const Matrix3x3 mat)
inline

Operator for Matrix3x3 += Matrix3x3.

Definition at line 423 of file IceMatrix3x3.h.

◆ operator-()

inline_ Matrix3x3 Matrix3x3::operator- ( const Matrix3x3 mat) const
inline

Operator for Matrix3x3 Minus = Matrix3x3 - Matrix3x3;.

Definition at line 357 of file IceMatrix3x3.h.

◆ operator-=()

inline_ Matrix3x3& Matrix3x3::operator-= ( const Matrix3x3 mat)
inline

Operator for Matrix3x3 -= Matrix3x3.

Definition at line 432 of file IceMatrix3x3.h.

◆ operator/()

inline_ Matrix3x3 Matrix3x3::operator/ ( float  s) const
inline

Operator for Matrix3x3 Div = Matrix3x3 / float;.

Definition at line 404 of file IceMatrix3x3.h.

◆ operator/=()

inline_ Matrix3x3& Matrix3x3::operator/= ( float  s)
inline

Operator for Matrix3x3 /= float.

Definition at line 472 of file IceMatrix3x3.h.

◆ operator[]() [1/2]

inline_ const Point& Matrix3x3::operator[] ( int  row) const
inline

Definition at line 487 of file IceMatrix3x3.h.

◆ operator[]() [2/2]

inline_ Point& Matrix3x3::operator[] ( int  row)
inline

Definition at line 488 of file IceMatrix3x3.h.

◆ Rot()

Matrix3x3& Matrix3x3::Rot ( float  angle,
const Point axis 
)

Make a rotation matrix about an arbitrary axis.

◆ RotX()

void Matrix3x3::RotX ( float  angle)

Set a rotation matrix around the X axis. 1 0 0 RX = 0 cx sx 0 -sx cx

◆ RotY()

void Matrix3x3::RotY ( float  angle)

Set a rotation matrix around the Y axis. cy 0 -sy RY = 0 1 0 sy 0 cy

◆ RotYX()

void Matrix3x3::RotYX ( float  y,
float  x 
)

cy sx.sy -sy.cx RY.RX 0 cx sx sy -sx.cy cx.cy

◆ RotZ()

void Matrix3x3::RotZ ( float  angle)

Set a rotation matrix around the Z axis. cz sz 0 RZ = -sz cz 0 0 0 1

◆ Scale() [1/2]

inline_ void Matrix3x3::Scale ( const Point p)
inline

Scales from a Point. Each row is multiplied by a component.

Definition at line 52 of file IceMatrix3x3.h.

◆ Scale() [2/2]

inline_ void Matrix3x3::Scale ( float  sx,
float  sy,
float  sz 
)
inline

Scales from floats. Each row is multiplied by a value.

Definition at line 60 of file IceMatrix3x3.h.

◆ Set()

inline_ void Matrix3x3::Set ( float  m00,
float  m01,
float  m02,
float  m10,
float  m11,
float  m12,
float  m20,
float  m21,
float  m22 
)
inline

Assign values.

Definition at line 38 of file IceMatrix3x3.h.

◆ SetCol()

inline_ void Matrix3x3::SetCol ( const udword  c,
const Point p 
)
inline

Sets a column.

Definition at line 82 of file IceMatrix3x3.h.

◆ SetRow()

inline_ void Matrix3x3::SetRow ( const udword  r,
const Point p 
)
inline

Sets a row.

Definition at line 78 of file IceMatrix3x3.h.

◆ SetScale() [1/2]

inline_ void Matrix3x3::SetScale ( const Point p)
inline

Sets the scale from a Point. The point is put on the diagonal.

Definition at line 46 of file IceMatrix3x3.h.

◆ SetScale() [2/2]

inline_ void Matrix3x3::SetScale ( float  sx,
float  sy,
float  sz 
)
inline

Sets the scale from floats. Values are put on the diagonal.

Definition at line 49 of file IceMatrix3x3.h.

◆ SkewSymmetric()

inline_ void Matrix3x3::SkewSymmetric ( const Point a)
inline

Makes a skew-symmetric matrix (a.k.a. Star(*) Matrix) [ 0.0 -a.z a.y ] [ a.z 0.0 -a.x ] [ -a.y a.x 0.0 ] This is also called a "cross matrix" since for any vectors A and B, A^B = Skew(A) * B = - B * Skew(A);

Definition at line 127 of file IceMatrix3x3.h.

◆ Sub() [1/2]

inline_ void Matrix3x3::Sub ( const Matrix3x3 mat)
inline

Sub another matrix.

Definition at line 167 of file IceMatrix3x3.h.

◆ Sub() [2/2]

inline_ void Matrix3x3::Sub ( const Matrix3x3 a,
const Matrix3x3 b 
)
inline

Definition at line 211 of file IceMatrix3x3.h.

◆ Trace()

inline_ float Matrix3x3::Trace ( ) const
inline

Computes the trace. The trace is the sum of the 3 diagonal components.

Definition at line 85 of file IceMatrix3x3.h.

◆ Transpose() [1/2]

void Matrix3x3::Transpose ( )
inline

Transpose the matrix.

Definition at line 287 of file IceMatrix3x3.h.

◆ Transpose() [2/2]

void Matrix3x3::Transpose ( const Matrix3x3 a)
inline

this = Transpose(a)

Definition at line 295 of file IceMatrix3x3.h.

◆ Zero()

inline_ void Matrix3x3::Zero ( )
inline

Clears the matrix.

Definition at line 87 of file IceMatrix3x3.h.

Friends And Related Function Documentation

◆ operator*

inline_ friend Matrix3x3 operator* ( float  s,
const Matrix3x3 mat 
)
friend

Operator for Matrix3x3 Mul = float * Matrix3x3;.

Definition at line 395 of file IceMatrix3x3.h.

◆ operator/

inline_ friend Matrix3x3 operator/ ( float  s,
const Matrix3x3 mat 
)
friend

Operator for Matrix3x3 Div = float / Matrix3x3;.

Definition at line 414 of file IceMatrix3x3.h.

Member Data Documentation

◆ m

float Matrix3x3::m[3][3]

Definition at line 492 of file IceMatrix3x3.h.


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


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:07