JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
frcsim::Matrix3 Struct Reference

3x3 matrix type used for rotations and inertia-tensor operations. More...

#include <matrix.hpp>

Public Member Functions

constexpr Matrix3 () noexcept
constexpr Matrix3 (double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22) noexcept
double * operator[] (size_t i)
const double * operator[] (size_t i) const
constexpr Matrix3 operator+ (const Matrix3 &o) const noexcept
constexpr Matrix3 operator- (const Matrix3 &o) const noexcept
constexpr Matrix3 operator* (double s) const noexcept
Vector3 operator* (const Vector3 &v) const noexcept
Matrix3 operator* (const Matrix3 &o) const noexcept
Matrix3 transpose () const noexcept
double determinant () const noexcept
bool tryInverse (Matrix3 &out, double eps=std::numeric_limits< double >::epsilon()) const noexcept
Matrix3 inverse () const noexcept
bool operator== (const Matrix3 &o) const noexcept
bool operator!= (const Matrix3 &o) const noexcept

Static Public Member Functions

static constexpr Matrix3 identity () noexcept
static constexpr Matrix3 zero () noexcept
static Matrix3 fromQuaternion (const Quaternion &q) noexcept

Public Attributes

double m [3][3]

Friends

std::ostream & operator<< (std::ostream &os, const Matrix3 &mat)

Detailed Description

3x3 matrix type used for rotations and inertia-tensor operations.

Physics principle: linear transformations in 3D Euclidean space. In rigid dynamics this type is used for tensor transforms, inverse-inertia calculations, and basis changes between local and world frames.

Reference: https://en.wikipedia.org/wiki/Inertia_tensor

Constructor & Destructor Documentation

◆ Matrix3() [1/2]

frcsim::Matrix3::Matrix3 ( )
inlineconstexprnoexcept

◆ Matrix3() [2/2]

frcsim::Matrix3::Matrix3 ( double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22 )
inlineconstexprnoexcept

Member Function Documentation

◆ determinant()

double frcsim::Matrix3::determinant ( ) const
inlinenoexcept

◆ fromQuaternion()

Matrix3 frcsim::Matrix3::fromQuaternion ( const Quaternion & q)
inlinestaticnoexcept

◆ identity()

constexpr Matrix3 frcsim::Matrix3::identity ( )
inlinestaticconstexprnoexcept

◆ inverse()

Matrix3 frcsim::Matrix3::inverse ( ) const
inlinenoexcept

◆ operator!=()

bool frcsim::Matrix3::operator!= ( const Matrix3 & o) const
inlinenoexcept

◆ operator*() [1/3]

Matrix3 frcsim::Matrix3::operator* ( const Matrix3 & o) const
inlinenoexcept

◆ operator*() [2/3]

Vector3 frcsim::Matrix3::operator* ( const Vector3 & v) const
inlinenoexcept

◆ operator*() [3/3]

Matrix3 frcsim::Matrix3::operator* ( double s) const
inlineconstexprnoexcept

◆ operator+()

Matrix3 frcsim::Matrix3::operator+ ( const Matrix3 & o) const
inlineconstexprnoexcept

◆ operator-()

Matrix3 frcsim::Matrix3::operator- ( const Matrix3 & o) const
inlineconstexprnoexcept

◆ operator==()

bool frcsim::Matrix3::operator== ( const Matrix3 & o) const
inlinenoexcept

◆ operator[]() [1/2]

double * frcsim::Matrix3::operator[] ( size_t i)
inline

◆ operator[]() [2/2]

const double * frcsim::Matrix3::operator[] ( size_t i) const
inline

◆ transpose()

Matrix3 frcsim::Matrix3::transpose ( ) const
inlinenoexcept

◆ tryInverse()

bool frcsim::Matrix3::tryInverse ( Matrix3 & out,
double eps = std::numeric_limits<double>::epsilon() ) const
inlinenoexcept

◆ zero()

constexpr Matrix3 frcsim::Matrix3::zero ( )
inlinestaticconstexprnoexcept

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Matrix3 & mat )
friend

Member Data Documentation

◆ m

double frcsim::Matrix3::m[3][3]

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