Go to the documentation of this file.
17 #ifndef GZ_MATH_MASSMATRIX3_HH_
18 #define GZ_MATH_MASSMATRIX3_HH_
25 #include <gz/math/config.hh>
38 inline namespace IGNITION_MATH_VERSION_NAMESPACE {
59 : mass(_mass), Ixxyyzz(_ixxyyzz), Ixyxzyz(_ixyxzyz)
65 : mass(_m.Mass()), Ixxyyzz(_m.DiagonalMoments()),
66 Ixyxzyz(_m.OffDiagonalMoments())
76 public:
bool IGN_DEPRECATED(5.0) Mass(const T &_m)
78 return this->SetMass(_m);
87 return this->IsValid();
107 public:
bool IGN_DEPRECATED(5.0) InertiaMatrix(
108 const T &_ixx, const T &_iyy, const T &_izz,
109 const T &_ixy, const T &_ixz, const T &_iyz)
111 return this->SetInertiaMatrix(_ixx, _iyy, _izz, _ixy, _ixz, _iyz);
123 const T &_ixx,
const T &_iyy,
const T &_izz,
124 const T &_ixy,
const T &_ixz,
const T &_iyz)
126 this->Ixxyyzz.Set(_ixx, _iyy, _izz);
127 this->Ixyxzyz.Set(_ixy, _ixz, _iyz);
128 return this->IsValid();
135 return this->Ixxyyzz;
142 return this->Ixyxzyz;
149 public:
bool IGN_DEPRECATED(5.0) DiagonalMoments(
152 return this->SetDiagonalMoments(_ixxyyzz);
160 this->Ixxyyzz = _ixxyyzz;
161 return this->IsValid();
168 public:
bool IGN_DEPRECATED(5.0) OffDiagonalMoments(
171 return this->SetOffDiagonalMoments(_ixyxzyz);
179 this->Ixyxzyz = _ixyxzyz;
180 return this->IsValid();
186 public: T IGN_DEPRECATED(5.0) IXX()
const
195 return this->Ixxyyzz[0];
201 public: T IGN_DEPRECATED(5.0) IYY()
const
210 return this->Ixxyyzz[1];
216 public: T IGN_DEPRECATED(5.0) IZZ()
const
225 return this->Ixxyyzz[2];
231 public: T IGN_DEPRECATED(5.0) IXY()
const
240 return this->Ixyxzyz[0];
246 public: T IGN_DEPRECATED(5.0) IXZ()
const
255 return this->Ixyxzyz[1];
261 public: T IGN_DEPRECATED(5.0) IYZ()
const
270 return this->Ixyxzyz[2];
277 public:
bool IGN_DEPRECATED(5.0) IXX(const T &_v)
279 return this->SetIxx(_v);
288 return this->IsValid();
295 public:
bool IGN_DEPRECATED(5.0) IYY(const T &_v)
297 return this->SetIyy(_v);
306 return this->IsValid();
313 public:
bool IGN_DEPRECATED(5.0) IZZ(const T &_v)
315 return this->SetIzz(_v);
324 return this->IsValid();
331 public:
bool IGN_DEPRECATED(5.0) IXY(const T &_v)
333 return this->SetIxy(_v);
342 return this->IsValid();
349 public:
bool IGN_DEPRECATED(5.0) IXZ(const T &_v)
351 return this->SetIxz(_v);
360 return this->IsValid();
367 public:
bool IGN_DEPRECATED(5.0) IYZ(const T &_v)
369 return this->SetIyz(_v);
378 return this->IsValid();
394 this->Ixxyyzz[0], this->Ixyxzyz[0], this->Ixyxzyz[1],
395 this->Ixyxzyz[0], this->Ixxyyzz[1], this->Ixyxzyz[2],
396 this->Ixyxzyz[1], this->Ixyxzyz[2], this->Ixxyyzz[2]);
405 public:
bool IGN_DEPRECATED(5.0) MOI(const
Matrix3<T> &_moi)
407 return this->SetMoi(_moi);
417 this->Ixxyyzz.Set(_moi(0, 0), _moi(1, 1), _moi(2, 2));
419 0.5*(_moi(0, 1) + _moi(1, 0)),
420 0.5*(_moi(0, 2) + _moi(2, 0)),
421 0.5*(_moi(1, 2) + _moi(2, 1)));
422 return this->IsValid();
430 this->mass = _massMatrix.
Mass();
443 return equal<T>(this->mass, _m.
Mass()) &&
453 return !(*
this == _m);
476 IGN_MASSMATRIX3_DEFAULT_TOLERANCE<T>)
const
478 const T epsilon = this->Epsilon(_tolerance);
482 return (this->mass >= 0) &&
483 (this->Ixx() + epsilon >= 0) &&
484 (this->Ixx() * this->Iyy() -
std::pow(this->Ixy(), 2) +
486 (this->Moi().Determinant() + epsilon >= 0);
509 IGN_MASSMATRIX3_DEFAULT_TOLERANCE<T>)
const
511 const T epsilon = this->Epsilon(_tolerance);
515 return (this->mass > 0) &&
516 (this->Ixx() + epsilon > 0) &&
517 (this->Ixx() * this->Iyy() -
std::pow(this->Ixy(), 2) +
519 (this->Moi().Determinant() + epsilon > 0);
530 IGN_MASSMATRIX3_DEFAULT_TOLERANCE<T>)
const
532 return Epsilon(this->DiagonalMoments(), _tolerance);
558 IGN_MASSMATRIX3_DEFAULT_TOLERANCE<T>)
575 T maxPossibleMoI = 0.5 * std::abs(_moments.
Sum());
596 IGN_MASSMATRIX3_DEFAULT_TOLERANCE<T>)
const
598 return this->IsNearPositive(_tolerance) &&
599 ValidMoments(this->PrincipalMoments(), _tolerance);
623 const T _tolerance = IGN_MASSMATRIX3_DEFAULT_TOLERANCE<T>)
625 T epsilon = Epsilon(_moments, _tolerance);
627 return _moments[0] + epsilon >= 0 &&
628 _moments[1] + epsilon >= 0 &&
629 _moments[2] + epsilon >= 0 &&
630 _moments[0] + _moments[1] + epsilon >= _moments[2] &&
631 _moments[1] + _moments[2] + epsilon >= _moments[0] &&
632 _moments[2] + _moments[0] + epsilon >= _moments[1];
649 T tol = _tol * this->Ixxyyzz.Max();
653 return this->Ixxyyzz;
664 T c = Id[0]*Id[1] -
std::pow(Ip[0], 2)
672 - 2*Ip[0]*Ip[1]*Ip[2];
687 T q = 2*
std::pow(b, 3) - 9*b*c - 27*d;
691 T delta = acos(clamp<T>(0.5 * q /
std::pow(p, 1.5), -1, 1));
694 T moment0 = (b + 2*sqrt(p) * cos(delta / 3.0)) / 3.0;
695 T moment1 = (b + 2*sqrt(p) * cos((delta + 2*
IGN_PI)/3.0)) / 3.0;
696 T moment2 = (b + 2*sqrt(p) * cos((delta - 2*
IGN_PI)/3.0)) / 3.0;
697 sort3(moment0, moment1, moment2);
714 Vector3<T> moments = this->PrincipalMoments(_tol);
716 T tol = _tol * this->Ixxyyzz.Max();
717 if (moments.
Equal(this->Ixxyyzz, tol) ||
718 (math::equal<T>(moments[0], moments[1], std::abs(tol)) &&
719 math::equal<T>(moments[0], moments[2], std::abs(tol))))
743 Vector2<T> f1(this->Ixyxzyz[0], -this->Ixyxzyz[1]);
744 Vector2<T> f2(this->Ixxyyzz[1] - this->Ixxyyzz[2],
745 -2*this->Ixyxzyz[2]);
749 Vector2<T> momentsDiff(moments[0] - moments[1],
750 moments[1] - moments[2]);
753 int unequalMoment = -1;
754 if (equal<T>(momentsDiff[0], 0, std::abs(tol)))
756 else if (equal<T>(momentsDiff[1], 0, std::abs(tol)))
759 if (unequalMoment >= 0)
764 T momentsDiff3 = moments[1] - moments[unequalMoment];
768 T s = (this->Ixxyyzz[0] - moments[unequalMoment]) / momentsDiff3;
774 T phi2 = acos(clamp<T>(ClampedSqrt(s), -1, 1));
783 math::Angle phi12(0.5*(Angle2(g2, tol) - Angle2(f2, tol)));
811 Vector2<T> g1a(0, 0.5*momentsDiff3 * sin(2*phi2));
814 math::Angle phi11a(Angle2(g1a, tol) - Angle2(f1, tol));
819 Vector2<T> g1b(0, 0.5*momentsDiff3 * sin(-2*phi2));
822 math::Angle phi11b(Angle2(g1b, tol) - Angle2(f1, tol));
851 if (unequalMoment == 0)
860 +(this->Ixxyyzz[0] - moments[2])
861 *(this->Ixxyyzz[0] + moments[2] - moments[0] - moments[1]))
862 / ((moments[1] - moments[2]) * (moments[2] - moments[0]));
865 if (v < std::abs(tol))
874 w = (this->Ixxyyzz[0] - moments[2] + (moments[2] - moments[1])*v)
875 / ((moments[0] - moments[1]) * v);
880 T phi2 = acos(clamp<T>(ClampedSqrt(v), -1, 1));
882 T phi3 = acos(clamp<T>(ClampedSqrt(w), -1, 1));
887 0.5* (moments[0]-moments[1])*ClampedSqrt(v)*sin(2*phi3),
888 0.5*((moments[0]-moments[1])*w + moments[1]-moments[2])*sin(2*phi2));
890 (moments[0]-moments[1])*(1 + (v-2)*w) + (moments[1]-moments[2])*v,
891 (moments[0]-moments[1])*sin(phi2)*sin(2*phi3));
906 if (f1small && f2small)
917 math::Angle phi12(0.5*(Angle2(g2, tol) - Angle2(f2, tol)));
924 math::Angle phi11(Angle2(g1, tol) - Angle2(f1, tol));
932 math::Angle phi11(Angle2(g1, tol) - Angle2(f1, tol));
935 math::Angle phi12(0.5*(Angle2(g2, tol) - Angle2(f2, tol)));
945 math::Angle phi11a(Angle2(g1a, tol) - Angle2(f1, tol));
946 math::Angle phi12a(0.5*(Angle2(g2a, tol) - Angle2(f2, tol)));
955 signsPhi23.
Set(-1, 1);
962 math::Angle phi11b(Angle2(g1b, tol) - Angle2(f1, tol));
963 math::Angle phi12b(0.5*(Angle2(g2b, tol) - Angle2(f2, tol)));
972 signsPhi23.
Set(1, -1);
979 math::Angle phi11c(Angle2(g1c, tol) - Angle2(f1, tol));
980 math::Angle phi12c(0.5*(Angle2(g2c, tol) - Angle2(f2, tol)));
988 signsPhi23.
Set(-1, -1);
993 phi2 *= signsPhi23[0];
994 phi3 *= signsPhi23[1];
1012 const T _tol = 1e-6)
const
1014 if (!this->IsPositive(0))
1020 Vector3<T> moments = this->PrincipalMoments(_tol);
1021 if (!ValidMoments(moments))
1032 _size.
X(sqrt(6*(moments.
Y() + moments.
Z() - moments.
X()) / this->mass));
1033 _size.
Y(sqrt(6*(moments.
Z() + moments.
X() - moments.
Y()) / this->mass));
1034 _size.
Z(sqrt(6*(moments.
X() + moments.
Y() - moments.
Z()) / this->mass));
1036 _rot = this->PrincipalAxesOffset(_tol);
1058 T volume = _size.
X() * _size.
Y() * _size.
Z();
1059 return this->SetFromBox(_mat.
Density() * volume, _size, _rot);
1077 this->SetMass(_mass);
1078 return this->SetFromBox(_size, _rot);
1091 if (this->Mass() <= 0 || _size.
Min() <= 0 ||
1102 L(0, 0) = this->mass / 12.0 * (y2 + z2);
1103 L(1, 1) = this->mass / 12.0 * (z2 + x2);
1104 L(2, 2) = this->mass / 12.0 * (x2 + y2);
1124 if (_mat.
Density() <= 0 || _length <= 0 || _radius <= 0 ||
1129 T volume =
IGN_PI * _radius * _radius * _length;
1130 return this->SetFromCylinderZ(_mat.
Density() * volume,
1131 _length, _radius, _rot);
1148 if (_mass <= 0 || _length <= 0 || _radius <= 0 ||
1153 this->SetMass(_mass);
1154 return this->SetFromCylinderZ(_length, _radius, _rot);
1169 if (this->Mass() <= 0 || _length <= 0 || _radius <= 0 ||
1178 L(0, 0) = this->mass / 12.0 * (3*radius2 +
std::pow(_length, 2));
1180 L(2, 2) = this->mass / 2.0 * radius2;
1194 if (_mat.
Density() <= 0 || _radius <= 0)
1200 return this->SetFromSphere(_mat.
Density() * volume, _radius);
1210 if (_mass <= 0 || _radius <= 0)
1214 this->SetMass(_mass);
1215 return this->SetFromSphere(_radius);
1225 if (this->Mass() <= 0 || _radius <= 0)
1233 L(0, 0) = 0.4 * this->mass * radius2;
1234 L(1, 1) = 0.4 * this->mass * radius2;
1235 L(2, 2) = 0.4 * this->mass * radius2;
1236 return this->SetMoi(L);
1242 private:
static inline T ClampedSqrt(
const T &_x)
1254 private:
static T Angle2(
const Vector2<T> &_v,
const T _eps = 1e-6)
1256 if (_v.SquaredLength() <
std::pow(_eps, 2))
1258 return atan2(_v[1], _v[0]);
1267 private: Vector3<T> Ixxyyzz;
1272 private: Vector3<T> Ixyxzyz;
bool DiagonalMoments(const Vector3< T > &_ixxyyzz)
Set the diagonal moments of inertia (Ixx, Iyy, Izz).
Definition: gz/math/MassMatrix3.hh:149
T Iyy() const
Get IYY.
Definition: gz/math/MassMatrix3.hh:208
T IXY() const
Get IXY.
Definition: gz/math/MassMatrix3.hh:231
bool operator!=(const MassMatrix3< T > &_m) const
Inequality test operator.
Definition: gz/math/MassMatrix3.hh:451
Two dimensional (x, y) vector.
Definition: gz/math/Vector2.hh:37
bool IXX(const T &_v)
Set IXX.
Definition: gz/math/MassMatrix3.hh:277
Definition: gz/math/AdditivelySeparableScalarField3.hh:27
MassMatrix3< float > MassMatrix3f
Definition: gz/math/MassMatrix3.hh:1276
#define IGN_PI
Define IGN_PI, IGN_PI_2, and IGN_PI_4. This was put here for Windows support.
Definition: gz/math/Helpers.hh:184
static bool ValidMoments(const Vector3< T > &_moments, const T _tolerance=IGN_MASSMATRIX3_DEFAULT_TOLERANCE< T >)
Verify that principal moments are positive and satisfy the triangle inequality.
Definition: gz/math/MassMatrix3.hh:622
bool SetFromCylinderZ(const T _length, const T _radius, const Quaternion< T > &_rot)
Set inertial properties based on equivalent cylinder aligned with Z axis using the current mass value...
Definition: gz/math/MassMatrix3.hh:1163
T IXX() const
Get IXX.
Definition: gz/math/MassMatrix3.hh:186
void Radian(double _radian)
Set the value from an angle in radians.
MassMatrix3(const T &_mass, const Vector3< T > &_ixxyyzz, const Vector3< T > &_ixyxzyz)
Constructor.
Definition: gz/math/MassMatrix3.hh:56
bool SetFromCylinderZ(const T _mass, const T _length, const T _radius, const Quaternion< T > &_rot=Quaternion< T >::Identity)
Set inertial properties based on mass and equivalent cylinder aligned with Z axis.
Definition: gz/math/MassMatrix3.hh:1141
T Ixx() const
Get IXX.
Definition: gz/math/MassMatrix3.hh:193
bool SetIzz(const T &_v)
Set IZZ.
Definition: gz/math/MassMatrix3.hh:321
bool IsValid(const T _tolerance=IGN_MASSMATRIX3_DEFAULT_TOLERANCE< T >) const
Verify that inertia values are positive semi-definite and satisfy the triangle inequality.
Definition: gz/math/MassMatrix3.hh:595
Contains information about a single material.
Definition: gz/math/Material.hh:65
T X() const
Get the x value.
Definition: gz/math/Vector3.hh:654
Matrix3< T > Moi() const
returns Moments of Inertia as a Matrix3
Definition: gz/math/MassMatrix3.hh:391
bool IYY(const T &_v)
Set IYY.
Definition: gz/math/MassMatrix3.hh:295
A 3x3 matrix class.
Definition: gz/math/Matrix3.hh:40
bool SetIyy(const T &_v)
Set IYY.
Definition: gz/math/MassMatrix3.hh:303
T Iyz() const
Get IYZ.
Definition: gz/math/MassMatrix3.hh:268
Matrix3< T > MOI() const
returns Moments of Inertia as a Matrix3
Definition: gz/math/MassMatrix3.hh:384
MassMatrix3< double > MassMatrix3d
Definition: gz/math/MassMatrix3.hh:1275
static T Epsilon(const Vector3< T > &_moments, const T _tolerance=IGN_MASSMATRIX3_DEFAULT_TOLERANCE< T >)
Get an epsilon value that represents the amount of acceptable error in a MassMatrix3....
Definition: gz/math/MassMatrix3.hh:556
bool SetOffDiagonalMoments(const Vector3< T > &_ixyxzyz)
Set the off-diagonal moments of inertia (Ixy, Ixz, Iyz).
Definition: gz/math/MassMatrix3.hh:177
virtual ~MassMatrix3()
Destructor.
Definition: gz/math/MassMatrix3.hh:70
bool IsNearPositive(const T _tolerance=IGN_MASSMATRIX3_DEFAULT_TOLERANCE< T >) const
Verify that inertia values are positive semidefinite.
Definition: gz/math/MassMatrix3.hh:475
bool SetInertiaMatrix(const T &_ixx, const T &_iyy, const T &_izz, const T &_ixy, const T &_ixz, const T &_iyz)
Set the moment of inertia matrix.
Definition: gz/math/MassMatrix3.hh:122
void Min(const Vector3< T > &_v)
Set this vector's components to the minimum of itself and the passed in vector.
Definition: gz/math/Vector3.hh:294
bool IYZ(const T &_v)
Set IYZ.
Definition: gz/math/MassMatrix3.hh:367
bool SetFromCylinderZ(const Material &_mat, const T _length, const T _radius, const Quaternion< T > &_rot=Quaternion< T >::Identity)
Set inertial properties based on a Material and equivalent cylinder aligned with Z axis.
Definition: gz/math/MassMatrix3.hh:1117
bool SetFromSphere(const Material &_mat, const T _radius)
Set inertial properties based on a material and equivalent sphere.
Definition: gz/math/MassMatrix3.hh:1191
Vector3< T > PrincipalMoments(const T _tol=1e-6) const
Compute principal moments of inertia, which are the eigenvalues of the moment of inertia matrix.
Definition: gz/math/MassMatrix3.hh:646
T Z() const
Get the z value.
Definition: gz/math/Vector3.hh:668
bool SetMoi(const Matrix3< T > &_moi)
Sets Moments of Inertia (MOI) from a Matrix3. Symmetric component of input matrix is used by averagin...
Definition: gz/math/MassMatrix3.hh:415
bool MOI(const Matrix3< T > &_moi)
Sets Moments of Inertia (MOI) from a Matrix3. Symmetric component of input matrix is used by averagin...
Definition: gz/math/MassMatrix3.hh:405
T IZZ() const
Get IZZ.
Definition: gz/math/MassMatrix3.hh:216
bool EquivalentBox(Vector3< T > &_size, Quaternion< T > &_rot, const T _tol=1e-6) const
Get dimensions and rotation offset of uniform box with equivalent mass and moment of inertia....
Definition: gz/math/MassMatrix3.hh:1010
T SquaredLength() const
Returns the square of the length (magnitude) of the vector.
Definition: gz/math/Vector2.hh:100
bool Mass(const T &_m)
Set the mass.
Definition: gz/math/MassMatrix3.hh:76
bool IXY(const T &_v)
Set IXY.
Definition: gz/math/MassMatrix3.hh:331
double Density() const
Get the density value of the material in kg/m^3.
MassMatrix3 & operator=(const MassMatrix3< T > &_massMatrix)
Equal operator.
Definition: gz/math/MassMatrix3.hh:428
The Vector3 class represents the generic vector containing 3 elements. Since it's commonly used to ke...
Definition: gz/math/Vector3.hh:41
MassMatrix3()
Default Constructor, which inializes the mass and moments to zero.
Definition: gz/math/MassMatrix3.hh:49
Vector3< T > DiagonalMoments() const
Get the diagonal moments of inertia (Ixx, Iyy, Izz).
Definition: gz/math/MassMatrix3.hh:133
bool SetFromBox(const Vector3< T > &_size, const Quaternion< T > &_rot=Quaternion< T >::Identity)
Set inertial properties based on equivalent box using the current mass value.
Definition: gz/math/MassMatrix3.hh:1086
Quaternion< T > PrincipalAxesOffset(const T _tol=1e-6) const
Compute rotational offset of principal axes.
Definition: gz/math/MassMatrix3.hh:712
void Set(T _x, T _y)
Set the contents of the vector.
Definition: gz/math/Vector2.hh:149
bool SetFromSphere(const T _mass, const T _radius)
Set inertial properties based on mass and equivalent sphere.
Definition: gz/math/MassMatrix3.hh:1207
bool SetIxz(const T &_v)
Set IXZ.
Definition: gz/math/MassMatrix3.hh:357
bool OffDiagonalMoments(const Vector3< T > &_ixyxzyz)
Set the off-diagonal moments of inertia (Ixy, Ixz, Iyz).
Definition: gz/math/MassMatrix3.hh:168
bool SetDiagonalMoments(const Vector3< T > &_ixxyyzz)
Set the diagonal moments of inertia (Ixx, Iyy, Izz).
Definition: gz/math/MassMatrix3.hh:158
bool IsPositive(const T _tolerance=IGN_MASSMATRIX3_DEFAULT_TOLERANCE< T >) const
Verify that inertia values are positive definite.
Definition: gz/math/MassMatrix3.hh:508
bool InertiaMatrix(const T &_ixx, const T &_iyy, const T &_izz, const T &_ixy, const T &_ixz, const T &_iyz)
Set the moment of inertia matrix.
Definition: gz/math/MassMatrix3.hh:107
T Epsilon(const T _tolerance=IGN_MASSMATRIX3_DEFAULT_TOLERANCE< T >) const
Get an epsilon value that represents the amount of acceptable error in a MassMatrix3....
Definition: gz/math/MassMatrix3.hh:529
bool Equal(const Vector3 &_v, const T &_tol) const
Equality test with tolerance.
Definition: gz/math/Vector3.hh:565
T IYZ() const
Get IYZ.
Definition: gz/math/MassMatrix3.hh:261
bool SetIxy(const T &_v)
Set IXY.
Definition: gz/math/MassMatrix3.hh:339
void Normalize()
Normalize the angle in the range -Pi to Pi. This modifies the value contained in this Angle instance.
T Izz() const
Get IZZ.
Definition: gz/math/MassMatrix3.hh:223
bool SetMass(const T &_m)
Set the mass.
Definition: gz/math/MassMatrix3.hh:84
MassMatrix3(const MassMatrix3< T > &_m)
Copy constructor.
Definition: gz/math/MassMatrix3.hh:64
The Angle class is used to simplify and clarify the use of radians and degrees measurements....
Definition: gz/math/Angle.hh:61
bool IXZ(const T &_v)
Set IXZ.
Definition: gz/math/MassMatrix3.hh:349
T Sum() const
Return the sum of the values.
Definition: gz/math/Vector3.hh:94
T Mass() const
Get the mass.
Definition: gz/math/MassMatrix3.hh:92
Quaternion< T > Inverse() const
Get the inverse of this quaternion.
Definition: gz/math/Quaternion.hh:132
void sort3(T &_a, T &_b, T &_c)
Sort three numbers, such that _a <= _b <= _c.
Definition: gz/math/Helpers.hh:612
bool SetIxx(const T &_v)
Set IXX.
Definition: gz/math/MassMatrix3.hh:285
Vector3< T > OffDiagonalMoments() const
Get the off-diagonal moments of inertia (Ixy, Ixz, Iyz).
Definition: gz/math/MassMatrix3.hh:140
bool SetIyz(const T &_v)
Set IYZ.
Definition: gz/math/MassMatrix3.hh:375
T Ixz() const
Get IXZ.
Definition: gz/math/MassMatrix3.hh:253
bool SetFromBox(const Material &_mat, const Vector3< T > &_size, const Quaternion< T > &_rot=Quaternion< T >::Identity)
Set inertial properties based on a Material and equivalent box.
Definition: gz/math/MassMatrix3.hh:1054
bool operator==(const MassMatrix3< T > &_m) const
Equality comparison operator.
Definition: gz/math/MassMatrix3.hh:441
T IXZ() const
Get IXZ.
Definition: gz/math/MassMatrix3.hh:246
T Y() const
Get the y value.
Definition: gz/math/Vector3.hh:661
#define IGN_PI_2
Definition: gz/math/Helpers.hh:185
bool IZZ(const T &_v)
Set IZZ.
Definition: gz/math/MassMatrix3.hh:313
T IYY() const
Get IYY.
Definition: gz/math/MassMatrix3.hh:201
bool SetFromSphere(const T _radius)
Set inertial properties based on equivalent sphere using the current mass value.
Definition: gz/math/MassMatrix3.hh:1222
bool SetFromBox(const T _mass, const Vector3< T > &_size, const Quaternion< T > &_rot=Quaternion< T >::Identity)
Set inertial properties based on mass and equivalent box.
Definition: gz/math/MassMatrix3.hh:1067
A class for inertial information about a rigid body consisting of the scalar mass and a 3x3 symmetric...
Definition: gz/math/MassMatrix3.hh:45
Matrix3< T > Transposed() const
Return the transpose of this matrix.
Definition: gz/math/Matrix3.hh:480
T Ixy() const
Get IXY.
Definition: gz/math/MassMatrix3.hh:238