Skip to main content

inertia_tensor()

Calculate the inertia tensor about the center of mass.

Usage

Source

inertia_tensor(geo)

Parameters

geo: Geometry
Geometry.

Returns

np.ndarray
Inertia tensor, shape (3, 3) (zero for an empty geometry).

Examples

    >>> import numpy as np
    >>> import autogeom
    >>> geo = autogeom.Geometry(
    ...     symbols=["O", "H", "H"],
    ...     coordinates=[[0, 0, 0], [1, 0, 0], [0, 1, 0]],
    ...     charge=0,
    ...     spin=0,
    ... )
    >>> tensor = autogeom.inertia_tensor(geo)
    >>> tensor.shape
(3, 3)
    >>> bool(np.allclose(tensor, tensor.T))
True