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 thepoints(). The default is to attribute a weight 1.0 to each point.
Returns#
InertiaThe 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#
principal_coordsys(): Return the principal axes of the inertia tensor
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