17 #ifndef GAZEBO_MATH_MATRIX3_HH_
18 #define GAZEBO_MATH_MATRIX3_HH_
21 #include <ignition/math/Matrix3.hh>
27 #pragma GCC diagnostic push
28 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
59 public:
Matrix3(
double _v00,
double _v01,
double _v02,
60 double _v10,
double _v11,
double _v12,
61 double _v20,
double _v21,
double _v22)
66 public:
Matrix3(
const ignition::math::Matrix3d &_m)
74 public: ignition::math::Matrix3d Ign()
const;
80 public:
void SetFromAxes(
const Vector3 &_xAxis,
88 public:
void SetFromAxis(
const Vector3 &_axis,
double _angle);
93 public:
void SetCol(
unsigned int _c,
const Vector3 &_v);
97 public:
Matrix3 Inverse()
const;
104 this->m[0][0]-_m[0][0], this->m[0][1]-_m[0][1], this->m[0][2]-_m[0][2],
105 this->m[1][0]-_m[1][0], this->m[1][1]-_m[1][1], this->m[1][2]-_m[1][2],
106 this->m[2][0]-_m[2][0], this->m[2][1]-_m[2][1], this->m[2][2]-_m[2][2]);
114 this->m[0][0]+_m[0][0], this->m[0][1]+_m[0][1], this->m[0][2]+_m[0][2],
115 this->m[1][0]+_m[1][0], this->m[1][1]+_m[1][1], this->m[1][2]+_m[1][2],
116 this->m[2][0]+_m[2][0], this->m[2][1]+_m[2][1], this->m[2][2]+_m[2][2]);
124 _s * this->m[0][0], _s * this->m[0][1], _s * this->m[0][2],
125 _s * this->m[1][0], _s * this->m[1][1], _s * this->m[1][2],
126 _s * this->m[2][0], _s * this->m[2][1], _s * this->m[2][2]);
144 this->m[0][0]*_m[0][0]+this->m[0][1]*_m[1][0]+this->m[0][2]*_m[2][0],
145 this->m[0][0]*_m[0][1]+this->m[0][1]*_m[1][1]+this->m[0][2]*_m[2][1],
146 this->m[0][0]*_m[0][2]+this->m[0][1]*_m[1][2]+this->m[0][2]*_m[2][2],
148 this->m[1][0]*_m[0][0]+this->m[1][1]*_m[1][0]+this->m[1][2]*_m[2][0],
149 this->m[1][0]*_m[0][1]+this->m[1][1]*_m[1][1]+this->m[1][2]*_m[2][1],
150 this->m[1][0]*_m[0][2]+this->m[1][1]*_m[1][2]+this->m[1][2]*_m[2][2],
152 this->m[2][0]*_m[0][0]+this->m[2][1]*_m[1][0]+this->m[2][2]*_m[2][0],
153 this->m[2][0]*_m[0][1]+this->m[2][1]*_m[1][1]+this->m[2][2]*_m[2][1],
154 this->m[2][0]*_m[0][2]+this->m[2][1]*_m[1][2]+this->m[2][2]*_m[2][2]);
160 public:
bool operator==(
const Matrix3 &_m)
const;
168 this->m[0][0]*_v.
x + this->m[0][1]*_v.
y + this->m[0][2]*_v.
z,
169 this->m[1][0]*_v.
x + this->m[1][1]*_v.
y + this->m[1][2]*_v.
z,
170 this->m[2][0]*_v.
x + this->m[2][1]*_v.
y + this->m[2][2]*_v.
z);
179 return this->m[_row];
188 return this->m[_row];
199 for (
int i = 0; i < 3; i++)
201 for (
int j = 0; j < 3; j++)
203 _out << _m.
m[i][j] <<
" ";
218 protected:
double m[3][3];
226 #pragma GCC diagnostic pop
double x
X location.
Definition: Vector3.hh:333
const double * operator[](size_t _row) const
Array subscript operator.
Definition: Matrix3.hh:176
double y
Y location.
Definition: Vector3.hh:336
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:44
static const double GAZEBO_DEPRECATED(8.0) MAX_D
Double maximum value. This value will be similar to 1.79769e+308.
Definition: Helpers.hh:140
A 3x3 matrix class.
Definition: Matrix4.hh:40
friend Matrix3 operator*(double _s, const Matrix3 &_m)
Multiplication operators.
Definition: Matrix3.hh:133
Matrix3 operator*(const double &_s) const
returns the element wise scalar multiplication
Definition: Matrix3.hh:120
static const Matrix3 IDENTITY
Identity matrix.
Definition: Matrix3.hh:212
double z
Z location.
Definition: Vector3.hh:339
Matrix3 operator*(const Matrix3 &_m) const
Matrix multiplication operator.
Definition: Matrix3.hh:140
A 3x3 matrix class.
Definition: Matrix3.hh:40
math::Vector3 operator*(const math::Vector3 &_v) const
Matrix times Vector3 operator.
Definition: Matrix3.hh:165
double m[3][3]
the 3x3 matrix
Definition: Matrix3.hh:218
double * operator[](size_t _row)
Array subscript operator.
Definition: Matrix3.hh:185
Matrix3 operator+(const Matrix3 &_m) const
returns the element wise sum of two matrices
Definition: Matrix3.hh:110
friend std::ostream & operator<<(std::ostream &_out, const gazebo::math::Matrix3 &_m)
Stream insertion operator.
Definition: Matrix3.hh:196
Matrix3 operator-(const Matrix3 &_m) const
returns the element wise difference of two matrices
Definition: Matrix3.hh:100
static const Matrix3 ZERO
Zero matrix.
Definition: Matrix3.hh:215