coords.Coords.inertia#

Coords.inertia(mass=None)#

Return inertia related quantities of the Coords.

Parameters#

mass: float array, optional

If provided, it is a 1-dim array with n_points() weight values for the points, in the order of the points(). The default is to attribute a weight 1.0 to each point.

Returns#

Inertia

The Inertia object has the following attributes:

  • mass: the total mass (float)

  • ctr: the center of mass: float (3,)

  • tensor: the inertia tensor in the central axes: shape (3,3)

See Also#

Examples#

>>> from hellotriangle.elements import Tet4
>>> I = Tet4.vertices.inertia()
>>> print(I.tensor)
[[1.5  0.25 0.25]
 [0.25 1.5  0.25]
 [0.25 0.25 1.5 ]]
>>> print(I.ctr)
[0.25 0.25 0.25]
>>> print(I.mass)
4.0