Simbody  3.7
SimTK::Inertia_< P > Class Template Reference

The physical meaning of an inertia is the distribution of a rigid body's mass about a particular point. More...

+ Inheritance diagram for SimTK::Inertia_< P >:

Public Member Functions

 Inertia_ ()
 Default is a NaN-ed out mess to avoid accidents, even in Release mode. More...
 
 Inertia_ (const P &moment)
 Create a principal inertia matrix with identical diagonal elements, like a sphere where moment=2/5 m r^2, or a cube where moment=1/6 m s^2, with m the total mass, r the sphere's radius and s the length of a side of the cube. More...
 
 Inertia_ (const Vec< 3, P > &p, const P &mass)
 Create an Inertia matrix for a point mass at a given location, measured from the origin OF of the implicit frame F, and expressed in F. More...
 
 Inertia_ (const Vec< 3, P > &moments, const Vec< 3, P > &products=Vec< 3, P >(0))
 Create an inertia matrix from a vector of the moments of inertia (the inertia matrix diagonal) and optionally a vector of the products of inertia (the off-diagonals). More...
 
 Inertia_ (const P &xx, const P &yy, const P &zz)
 Create a principal inertia matrix (only non-zero on diagonal). More...
 
 Inertia_ (const P &xx, const P &yy, const P &zz, const P &xy, const P &xz, const P &yz)
 This is a general inertia matrix. More...
 
 Inertia_ (const SymMat< 3, P > &inertia)
 Construct an Inertia from a symmetric 3x3 matrix. More...
 
 Inertia_ (const Mat< 3, 3, P > &m)
 Construct an Inertia matrix from a 3x3 symmetric matrix. More...
 
Inertia_setInertia (const P &xx, const P &yy, const P &zz)
 Set an inertia matrix to have only principal moments (that is, it will be diagonal). More...
 
Inertia_setInertia (const Vec< 3, P > &moments, const Vec< 3, P > &products=Vec< 3, P >(0))
 Set principal moments and optionally off-diagonal terms. More...
 
Inertia_setInertia (const P &xx, const P &yy, const P &zz, const P &xy, const P &xz, const P &yz)
 Set this Inertia to a general matrix. More...
 
Inertia_operator+= (const Inertia_ &inertia)
 Add in another inertia matrix. More...
 
Inertia_operator-= (const Inertia_ &inertia)
 Subtract off another inertia matrix. More...
 
Inertia_operator*= (const P &s)
 Multiply this inertia matrix by a scalar. Cost is 6 flops. More...
 
Inertia_operator/= (const P &s)
 Divide this inertia matrix by a scalar. More...
 
Inertia_ shiftToMassCenter (const Vec< 3, P > &CF, const P &mass) const
 Assume that the current inertia is about the F frame's origin OF, and expressed in F. More...
 
Inertia_shiftToMassCenterInPlace (const Vec< 3, P > &CF, const P &mass)
 Assume that the current inertia is about the F frame's origin OF, and expressed in F. More...
 
Inertia_ shiftFromMassCenter (const Vec< 3, P > &p, const P &mass) const
 Assuming that the current inertia I is a central inertia (that is, it is inertia about the body center of mass CF), shift it to some other point p measured from the center of mass. More...
 
Inertia_shiftFromMassCenterInPlace (const Vec< 3, P > &p, const P &mass)
 Assuming that the current inertia I is a central inertia (that is, it is inertia about the body center of mass CF), shift it to some other point p measured from the center of mass. More...
 
Inertia_ reexpress (const Rotation_< P > &R_FB) const
 Return a new inertia matrix like this one but re-expressed in another frame (leaving the origin point unchanged). More...
 
Inertia_ reexpress (const InverseRotation_< P > &R_FB) const
 Rexpress using an inverse rotation to avoid having to convert it. More...
 
Inertia_reexpressInPlace (const Rotation_< P > &R_FB)
 Re-express this inertia matrix in another frame, changing the object in place; see reexpress() if you want to leave this object unmolested and get a new one instead. More...
 
Inertia_reexpressInPlace (const InverseRotation_< P > &R_FB)
 Rexpress in place using an inverse rotation to avoid having to convert it. More...
 
trace () const
 
 operator const SymMat< 3, P > & () const
 This is an implicit conversion to a const SymMat33. More...
 
const SymMat< 3, P > & asSymMat33 () const
 Obtain a reference to the underlying symmetric matrix type. More...
 
Mat< 3, 3, P > toMat33 () const
 Expand the internal packed representation into a full 3x3 symmetric matrix with all elements set. More...
 
const Vec< 3, P > & getMoments () const
 Obtain the inertia moments (diagonal of the Inertia matrix) as a Vec3 ordered xx, yy, zz. More...
 
const Vec< 3, P > & getProducts () const
 Obtain the inertia products (off-diagonals of the Inertia matrix) as a Vec3 with elements ordered xy, xz, yz. More...
 
bool isNaN () const
 
bool isInf () const
 
bool isFinite () const
 
bool isNumericallyEqual (const Inertia_< P > &other) const
 Compare this inertia matrix with another one and return true if they are close to within a default numerical tolerance. More...
 
bool isNumericallyEqual (const Inertia_< P > &other, double tol) const
 Compare this inertia matrix with another one and return true if they are close to within a specified numerical tolerance. More...
 

Static Public Member Functions

static bool isValidInertiaMatrix (const SymMat< 3, P > &m)
 Test some conditions that must hold for a valid Inertia matrix. More...
 
static Inertia_ pointMassAtOrigin ()
 Create an Inertia matrix for a point located at the origin – that is, an all-zero matrix. More...
 
static Inertia_ pointMassAt (const Vec< 3, P > &p, const P &m)
 Create an Inertia matrix for a point of a given mass, located at a given location measured from the origin of the implicit F frame. More...
 
Unit inertia matrix factories

These return UnitInertia matrices (inertias of unit-mass objects) converted to Inertias.

Multiply the result by the actual mass to get the Inertia of an actual object of this shape. See the UnitInertia class for more information.

static Inertia_ sphere (const P &r)
 Create a UnitInertia matrix for a unit mass sphere of radius r centered at the origin. More...
 
static Inertia_ cylinderAlongZ (const P &r, const P &hz)
 Unit-mass cylinder aligned along z axis; use radius and half-length. More...
 
static Inertia_ cylinderAlongY (const P &r, const P &hy)
 Unit-mass cylinder aligned along y axis; use radius and half-length. More...
 
static Inertia_ cylinderAlongX (const P &r, const P &hx)
 Unit-mass cylinder aligned along x axis; use radius and half-length. More...
 
static Inertia_ brick (const P &hx, const P &hy, const P &hz)
 Unit-mass brick given by half-lengths in each direction. More...
 
static Inertia_ brick (const Vec< 3, P > &halfLengths)
 Alternate interface to brick() that takes a Vec3 for the half lengths. More...
 
static Inertia_ ellipsoid (const P &hx, const P &hy, const P &hz)
 Unit-mass ellipsoid given by half-lengths in each direction. More...
 
static Inertia_ ellipsoid (const Vec< 3, P > &halfLengths)
 Alternate interface to ellipsoid() that takes a Vec3 for the half lengths. More...
 

Protected Member Functions

const UnitInertia_< P > & getAsUnitInertia () const
 
UnitInertia_< P > & updAsUnitInertia ()
 
void errChk (const char *methodName) const
 

Protected Attributes

SymMat< 3, P > I_OF_F
 

Related Functions

(Note that these are not member functions.)

template<class P >
Inertia_< P > operator+ (const Inertia_< P > &l, const Inertia_< P > &r)
 Add two compatible inertia matrices, meaning they must be taken about the same point and expressed in the same frame. More...
 
template<class P >
Inertia_< P > operator- (const Inertia_< P > &l, const Inertia_< P > &r)
 Subtract from one inertia matrix another one which is compatible, meaning that both must be taken about the same point and expressed in the same frame. More...
 
template<class P >
Inertia_< P > operator* (const Inertia_< P > &i, const P &r)
 Multiply an inertia matrix by a scalar. More...
 
template<class P >
Inertia_< P > operator* (const P &r, const Inertia_< P > &i)
 Multiply an inertia matrix by a scalar. More...
 
template<class P >
Inertia_< P > operator* (const Inertia_< P > &i, int r)
 Multiply an inertia matrix by a scalar given as an int. More...
 
template<class P >
Inertia_< P > operator* (int r, const Inertia_< P > &i)
 Multiply an inertia matrix by a scalar given as an int. More...
 
template<class P >
Inertia_< P > operator/ (const Inertia_< P > &i, const P &r)
 Divide an inertia matrix by a scalar. More...
 
template<class P >
Inertia_< P > operator/ (const Inertia_< P > &i, int r)
 Divide an inertia matrix by a scalar provided as an int. More...
 
template<class P >
Vec< 3, P > operator* (const Inertia_< P > &I, const Vec< 3, P > &w)
 Multiply an inertia matrix I on the right by a vector w giving the vector result I*w. More...
 
template<class P >
bool operator== (const Inertia_< P > &i1, const Inertia_< P > &i2)
 Compare two inertia matrices for exact (bitwise) equality. More...
 
template<class P >
std::ostream & operator<< (std::ostream &o, const Inertia_< P > &inertia)
 Output a human-readable representation of an inertia matrix to the indicated stream. More...
 

Detailed Description

template<class P>
class SimTK::Inertia_< P >

The physical meaning of an inertia is the distribution of a rigid body's mass about a particular point.

If that point is the center of mass of the body, then the measured inertia is called the "central inertia" of that body. To write down the inertia, we need to calculate the six scalars of the inertia tensor, which is a symmetric 3x3 matrix. These scalars must be expressed in an arbitrary but specified coordinate system. So an Inertia is meaningful only in conjunction with a particular set of axes, fixed to the body, whose origin is the point about which the inertia is being measured, and in whose coordinate system this measurement is being expressed. Note that changing the reference point results in a new physical quantity, but changing the reference axes only affects the measure numbers of that quantity. For any reference point, there is a unique set of reference axes in which the inertia tensor is diagonal; those are called the "principal axes" of the body at that point, and the resulting diagonal elements are the "principal moments of inertia". When we speak of an inertia being "in" a frame, we mean the physical quantity measured about the frame's origin and then expressed in the frame's axes.

This low-level Inertia class does not attempt to keep track of which frame it is in. It provides construction and operations involving inertia that can proceed using only an implicit frame F. Clients of this class are responsible for keeping track of that frame. In particular, in order to shift the inertia's "measured-about" point one must know whether either the starting or final inertia is central, because we must always shift inertias by passing through the central inertia. So this class provides operations for doing the shifting, but expects to be told by the client where to find the center of mass.

Re-expressing an Inertia in a different coordinate system does not entail a change of physical meaning in the way that shifting it to a different point does. Note that because inertia is a tensor, there is a "left frame" and "right frame". For our purposes, these will always be the same so we'll only indicate the frame once, as in 'I_pt_frame'. This should be understood to mean 'frame_I_pt_frame' and re-expressing an Inertia requires both a left and right multiply by the rotation matrix. So I_OB_B is the inertia about body B's origin point OB, expressed in B, while I_OB_G is the same physical quantity but expressed in Ground (the latter is a component of the Spatial Inertia which we usually want in the Ground frame). Frame conversion is done logically like this:

   I_OB_G = R_GB * I_OB_B * R_BG  (R_BG=~R_GB)

but we can save computation time by performing this as a single operation.

The central inertia would be I_CB_B for body B.

A Inertia is a symmetric matrix and is positive definite for nonsingular bodies (that is, a body composed of at least three noncollinear point masses).

Some attempt is made to check the validity of an Inertia matrix, at least when running in Debug mode. Some conditions it must satisfy are:

  • must be symmetric
  • all diagonal elements must be nonnegative
  • diagonal elements must satisfy the triangle inequality (sum of any two is greater than or equal the other one)

Abbreviations

Typedefs exist for the most common invocations of Inertia_<P>:

  • Inertia for default Real precision (this is almost always used)
  • fInertia for single (float) precision
  • dInertia for double precision

Constructor & Destructor Documentation

◆ Inertia_() [1/8]

template<class P>
SimTK::Inertia_< P >::Inertia_ ( )
inline

Default is a NaN-ed out mess to avoid accidents, even in Release mode.

Other than this value, an Inertia matrix should always be valid.

◆ Inertia_() [2/8]

template<class P>
SimTK::Inertia_< P >::Inertia_ ( const P &  moment)
inlineexplicit

Create a principal inertia matrix with identical diagonal elements, like a sphere where moment=2/5 m r^2, or a cube where moment=1/6 m s^2, with m the total mass, r the sphere's radius and s the length of a side of the cube.

Note that many rigid bodies of different shapes and masses can have the same inertia matrix.

◆ Inertia_() [3/8]

template<class P>
SimTK::Inertia_< P >::Inertia_ ( const Vec< 3, P > &  p,
const P &  mass 
)
inline

Create an Inertia matrix for a point mass at a given location, measured from the origin OF of the implicit frame F, and expressed in F.

Cost is 14 flops.

◆ Inertia_() [4/8]

template<class P>
SimTK::Inertia_< P >::Inertia_ ( const Vec< 3, P > &  moments,
const Vec< 3, P > &  products = Vec<3,P>(0) 
)
inlineexplicit

Create an inertia matrix from a vector of the moments of inertia (the inertia matrix diagonal) and optionally a vector of the products of inertia (the off-diagonals).

Moments are in the order xx,yy,zz; products are xy,xz,yz.

◆ Inertia_() [5/8]

template<class P>
SimTK::Inertia_< P >::Inertia_ ( const P &  xx,
const P &  yy,
const P &  zz 
)
inline

Create a principal inertia matrix (only non-zero on diagonal).

◆ Inertia_() [6/8]

template<class P>
SimTK::Inertia_< P >::Inertia_ ( const P &  xx,
const P &  yy,
const P &  zz,
const P &  xy,
const P &  xz,
const P &  yz 
)
inline

This is a general inertia matrix.

Note the order of these arguments: moments of inertia first, then products of inertia.

◆ Inertia_() [7/8]

template<class P>
SimTK::Inertia_< P >::Inertia_ ( const SymMat< 3, P > &  inertia)
inlineexplicit

Construct an Inertia from a symmetric 3x3 matrix.

The diagonals must be nonnegative and satisfy the triangle inequality.

◆ Inertia_() [8/8]

template<class P>
SimTK::Inertia_< P >::Inertia_ ( const Mat< 3, 3, P > &  m)
inlineexplicit

Construct an Inertia matrix from a 3x3 symmetric matrix.

In Debug mode we'll test that the supplied matrix is numerically close to symmetric, and that it satisfies other requirements of an Inertia matrix.

Member Function Documentation

◆ setInertia() [1/3]

template<class P>
Inertia_& SimTK::Inertia_< P >::setInertia ( const P &  xx,
const P &  yy,
const P &  zz 
)
inline

Set an inertia matrix to have only principal moments (that is, it will be diagonal).

Returns a reference to "this" like an assignment operator.

◆ setInertia() [2/3]

template<class P>
Inertia_& SimTK::Inertia_< P >::setInertia ( const Vec< 3, P > &  moments,
const Vec< 3, P > &  products = Vec<3,P>(0) 
)
inline

Set principal moments and optionally off-diagonal terms.

Returns a reference to "this" like an assignment operator.

◆ setInertia() [3/3]

template<class P>
Inertia_& SimTK::Inertia_< P >::setInertia ( const P &  xx,
const P &  yy,
const P &  zz,
const P &  xy,
const P &  xz,
const P &  yz 
)
inline

Set this Inertia to a general matrix.

Note the order of these arguments: moments of inertia first, then products of inertia. Behaves like an assignment statement. Will throw an error message in Debug mode if the supplied elements do not constitute a valid Inertia matrix.

◆ operator+=()

template<class P>
Inertia_& SimTK::Inertia_< P >::operator+= ( const Inertia_< P > &  inertia)
inline

Add in another inertia matrix.

Frames and reference point must be the same but we can't check. (6 flops)

◆ operator-=()

template<class P>
Inertia_& SimTK::Inertia_< P >::operator-= ( const Inertia_< P > &  inertia)
inline

Subtract off another inertia matrix.

Frames and reference point must be the same but we can't check. (6 flops)

◆ operator*=()

template<class P>
Inertia_& SimTK::Inertia_< P >::operator*= ( const P &  s)
inline

Multiply this inertia matrix by a scalar. Cost is 6 flops.

◆ operator/=()

template<class P>
Inertia_& SimTK::Inertia_< P >::operator/= ( const P &  s)
inline

Divide this inertia matrix by a scalar.

Cost is about 20 flops (a divide and 6 multiplies).

◆ shiftToMassCenter()

template<class P>
Inertia_ SimTK::Inertia_< P >::shiftToMassCenter ( const Vec< 3, P > &  CF,
const P &  mass 
) const
inline

Assume that the current inertia is about the F frame's origin OF, and expressed in F.

Given the vector from OF to the body center of mass CF, and the mass m of the body, we can shift the inertia to the center of mass. This produces a new Inertia I' whose (implicit) frame F' is aligned with F but has origin CF (an inertia like that is called a "central inertia". I' = I - Icom where Icom is the inertia of a fictitious point mass of mass m (that is, the same as the body mass) located at CF (measured in F) about OF. Cost is 20 flops.

See also
shiftToMassCenterInPlace(), shiftFromMassCenter()

◆ shiftToMassCenterInPlace()

template<class P>
Inertia_& SimTK::Inertia_< P >::shiftToMassCenterInPlace ( const Vec< 3, P > &  CF,
const P &  mass 
)
inline

Assume that the current inertia is about the F frame's origin OF, and expressed in F.

Given the vector from OF to the body center of mass CF, and the mass m of the body, we can shift the inertia to the center of mass. This produces a new Inertia I' whose (implicit) frame F' is aligned with F but has origin CF (an inertia like that is called a "central inertia". I' = I - Icom where Icom is the inertia of a fictitious point mass of mass m (that is, the same as the body mass) located at CF (measured in F) about OF. Cost is 20 flops.

See also
shiftToMassCenter() if you want to leave this object unmolested.
shiftFromMassCenterInPlace()

◆ shiftFromMassCenter()

template<class P>
Inertia_ SimTK::Inertia_< P >::shiftFromMassCenter ( const Vec< 3, P > &  p,
const P &  mass 
) const
inline

Assuming that the current inertia I is a central inertia (that is, it is inertia about the body center of mass CF), shift it to some other point p measured from the center of mass.

This produces a new inertia I' about the point p given by I' = I + Ip where Ip is the inertia of a fictitious point mass of mass mtot (the total body mass) located at p, about CF. Cost is 20 flops.

See also
shiftFromMassCenterInPlace(), shiftToMassCenter()

◆ shiftFromMassCenterInPlace()

template<class P>
Inertia_& SimTK::Inertia_< P >::shiftFromMassCenterInPlace ( const Vec< 3, P > &  p,
const P &  mass 
)
inline

Assuming that the current inertia I is a central inertia (that is, it is inertia about the body center of mass CF), shift it to some other point p measured from the center of mass.

This produces a new inertia I' about the point p given by I' = I + Ip where Ip is the inertia of a fictitious point mass of mass mtot (the total body mass) located at p, about CF. Cost is 20 flops.

See also
shiftFromMassCenter() if you want to leave this object unmolested.
shiftToMassCenterInPlace()

◆ reexpress() [1/2]

template<class P>
Inertia_ SimTK::Inertia_< P >::reexpress ( const Rotation_< P > &  R_FB) const
inline

Return a new inertia matrix like this one but re-expressed in another frame (leaving the origin point unchanged).

Call this inertia matrix I_OF_F, that is, it is taken about the origin of some frame F, and expressed in F. We want to return I_OF_B, the same inertia matrix, still taken about the origin of F, but expressed in the B frame, given by I_OF_B=R_BF*I_OF_F*R_FB where R_FB is the rotation matrix giving the orientation of frame B in F. This is handled here by a special method of the Rotation class which rotates a symmetric tensor at a cost of 57 flops.

See also
reexpressInPlace()

◆ reexpress() [2/2]

template<class P>
Inertia_ SimTK::Inertia_< P >::reexpress ( const InverseRotation_< P > &  R_FB) const
inline

Rexpress using an inverse rotation to avoid having to convert it.

See also
rexpress(Rotation) for information

◆ reexpressInPlace() [1/2]

template<class P>
Inertia_& SimTK::Inertia_< P >::reexpressInPlace ( const Rotation_< P > &  R_FB)
inline

Re-express this inertia matrix in another frame, changing the object in place; see reexpress() if you want to leave this object unmolested and get a new one instead.

Cost is 57 flops.

See also
reexpress() if you want to leave this object unmolested.

◆ reexpressInPlace() [2/2]

template<class P>
Inertia_& SimTK::Inertia_< P >::reexpressInPlace ( const InverseRotation_< P > &  R_FB)
inline

Rexpress in place using an inverse rotation to avoid having to convert it.

See also
rexpressInPlace(Rotation) for information

◆ trace()

template<class P>
P SimTK::Inertia_< P >::trace ( ) const
inline

◆ operator const SymMat< 3, P > &()

template<class P>
SimTK::Inertia_< P >::operator const SymMat< 3, P > & ( ) const
inline

This is an implicit conversion to a const SymMat33.

◆ asSymMat33()

template<class P>
const SymMat<3,P>& SimTK::Inertia_< P >::asSymMat33 ( ) const
inline

Obtain a reference to the underlying symmetric matrix type.

◆ toMat33()

template<class P>
Mat<3,3,P> SimTK::Inertia_< P >::toMat33 ( ) const
inline

Expand the internal packed representation into a full 3x3 symmetric matrix with all elements set.

◆ getMoments()

template<class P>
const Vec<3,P>& SimTK::Inertia_< P >::getMoments ( ) const
inline

Obtain the inertia moments (diagonal of the Inertia matrix) as a Vec3 ordered xx, yy, zz.

◆ getProducts()

template<class P>
const Vec<3,P>& SimTK::Inertia_< P >::getProducts ( ) const
inline

Obtain the inertia products (off-diagonals of the Inertia matrix) as a Vec3 with elements ordered xy, xz, yz.

◆ isNaN()

template<class P>
bool SimTK::Inertia_< P >::isNaN ( ) const
inline

◆ isInf()

template<class P>
bool SimTK::Inertia_< P >::isInf ( ) const
inline

◆ isFinite()

template<class P>
bool SimTK::Inertia_< P >::isFinite ( ) const
inline

◆ isNumericallyEqual() [1/2]

template<class P>
bool SimTK::Inertia_< P >::isNumericallyEqual ( const Inertia_< P > &  other) const
inline

Compare this inertia matrix with another one and return true if they are close to within a default numerical tolerance.

Cost is about 30 flops.

◆ isNumericallyEqual() [2/2]

template<class P>
bool SimTK::Inertia_< P >::isNumericallyEqual ( const Inertia_< P > &  other,
double  tol 
) const
inline

Compare this inertia matrix with another one and return true if they are close to within a specified numerical tolerance.

Cost is about 30 flops.

◆ isValidInertiaMatrix()

template<class P>
static bool SimTK::Inertia_< P >::isValidInertiaMatrix ( const SymMat< 3, P > &  m)
inlinestatic

Test some conditions that must hold for a valid Inertia matrix.

Cost is about 25 flops.

◆ pointMassAtOrigin()

template<class P>
static Inertia_ SimTK::Inertia_< P >::pointMassAtOrigin ( )
inlinestatic

Create an Inertia matrix for a point located at the origin – that is, an all-zero matrix.

◆ pointMassAt()

template<class P>
static Inertia_ SimTK::Inertia_< P >::pointMassAt ( const Vec< 3, P > &  p,
const P &  m 
)
inlinestatic

Create an Inertia matrix for a point of a given mass, located at a given location measured from the origin of the implicit F frame.

This is equivalent to m*crossMatSq(p) but is implemented elementwise here for speed, giving a cost of 14 flops.

◆ sphere()

template<class P >
Inertia_< P > SimTK::Inertia_< P >::sphere ( const P &  r)
inlinestatic

Create a UnitInertia matrix for a unit mass sphere of radius r centered at the origin.

◆ cylinderAlongZ()

template<class P >
Inertia_< P > SimTK::Inertia_< P >::cylinderAlongZ ( const P &  r,
const P &  hz 
)
inlinestatic

Unit-mass cylinder aligned along z axis; use radius and half-length.

If r==0 this is a thin rod; hz=0 it is a thin disk.

◆ cylinderAlongY()

template<class P >
Inertia_< P > SimTK::Inertia_< P >::cylinderAlongY ( const P &  r,
const P &  hy 
)
inlinestatic

Unit-mass cylinder aligned along y axis; use radius and half-length.

If r==0 this is a thin rod; hy=0 it is a thin disk.

◆ cylinderAlongX()

template<class P >
Inertia_< P > SimTK::Inertia_< P >::cylinderAlongX ( const P &  r,
const P &  hx 
)
inlinestatic

Unit-mass cylinder aligned along x axis; use radius and half-length.

If r==0 this is a thin rod; hx=0 it is a thin disk.

◆ brick() [1/2]

template<class P >
Inertia_< P > SimTK::Inertia_< P >::brick ( const P &  hx,
const P &  hy,
const P &  hz 
)
inlinestatic

Unit-mass brick given by half-lengths in each direction.

One dimension zero gives inertia of a thin rectangular sheet; two zero gives inertia of a thin rod in the remaining direction.

◆ brick() [2/2]

template<class P >
Inertia_< P > SimTK::Inertia_< P >::brick ( const Vec< 3, P > &  halfLengths)
inlinestatic

Alternate interface to brick() that takes a Vec3 for the half lengths.

◆ ellipsoid() [1/2]

template<class P >
Inertia_< P > SimTK::Inertia_< P >::ellipsoid ( const P &  hx,
const P &  hy,
const P &  hz 
)
inlinestatic

Unit-mass ellipsoid given by half-lengths in each direction.

◆ ellipsoid() [2/2]

template<class P >
Inertia_< P > SimTK::Inertia_< P >::ellipsoid ( const Vec< 3, P > &  halfLengths)
inlinestatic

Alternate interface to ellipsoid() that takes a Vec3 for the half lengths.

◆ getAsUnitInertia()

template<class P>
const UnitInertia_<P>& SimTK::Inertia_< P >::getAsUnitInertia ( ) const
inlineprotected

◆ updAsUnitInertia()

template<class P>
UnitInertia_<P>& SimTK::Inertia_< P >::updAsUnitInertia ( )
inlineprotected

◆ errChk()

template<class P>
void SimTK::Inertia_< P >::errChk ( const char *  methodName) const
inlineprotected

Friends And Related Function Documentation

◆ operator+()

template<class P >
Inertia_< P > operator+ ( const Inertia_< P > &  l,
const Inertia_< P > &  r 
)
related

Add two compatible inertia matrices, meaning they must be taken about the same point and expressed in the same frame.

There is no way to verify compatibility; make sure you know what you're doing. Cost is 6 flops.

◆ operator-()

template<class P >
Inertia_< P > operator- ( const Inertia_< P > &  l,
const Inertia_< P > &  r 
)
related

Subtract from one inertia matrix another one which is compatible, meaning that both must be taken about the same point and expressed in the same frame.

There is no way to verify compatibility; make sure you know what you're doing. Cost is 6 flops.

◆ operator*() [1/5]

template<class P >
Inertia_< P > operator* ( const Inertia_< P > &  i,
const P &  r 
)
related

Multiply an inertia matrix by a scalar.

Cost is 6 flops.

◆ operator*() [2/5]

template<class P >
Inertia_< P > operator* ( const P &  r,
const Inertia_< P > &  i 
)
related

Multiply an inertia matrix by a scalar.

Cost is 6 flops.

◆ operator*() [3/5]

template<class P >
Inertia_< P > operator* ( const Inertia_< P > &  i,
int  r 
)
related

Multiply an inertia matrix by a scalar given as an int.

Cost is 6 flops.

◆ operator*() [4/5]

template<class P >
Inertia_< P > operator* ( int  r,
const Inertia_< P > &  i 
)
related

Multiply an inertia matrix by a scalar given as an int.

Cost is 6 flops.

◆ operator/() [1/2]

template<class P >
Inertia_< P > operator/ ( const Inertia_< P > &  i,
const P &  r 
)
related

Divide an inertia matrix by a scalar.

Cost is about 20 flops (one divide and six multiplies).

◆ operator/() [2/2]

template<class P >
Inertia_< P > operator/ ( const Inertia_< P > &  i,
int  r 
)
related

Divide an inertia matrix by a scalar provided as an int.

Cost is about 20 flops (one divide and six multiplies).

◆ operator*() [5/5]

template<class P >
Vec< 3, P > operator* ( const Inertia_< P > &  I,
const Vec< 3, P > &  w 
)
related

Multiply an inertia matrix I on the right by a vector w giving the vector result I*w.

◆ operator==()

template<class P >
bool operator== ( const Inertia_< P > &  i1,
const Inertia_< P > &  i2 
)
related

Compare two inertia matrices for exact (bitwise) equality.

This is too strict for most purposes; use Inertia::isNumericallyEqual() instead to test for approximate equality. Cost here is 6 flops.

◆ operator<<()

template<class P >
std::ostream & operator<< ( std::ostream &  o,
const Inertia_< P > &  inertia 
)
related

Output a human-readable representation of an inertia matrix to the indicated stream.

Member Data Documentation

◆ I_OF_F

template<class P>
SymMat<3,P> SimTK::Inertia_< P >::I_OF_F
protected

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