Structure.center_of_mass#

Structure.center_of_mass()[source]#

Calculate the center of mass of the structure.

Returns:
NDArray

The center of mass of the structure.

Examples

>>> from importlib_resources import files
>>> from tme import Structure
>>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
>>> structure = Structure.from_file(filename=fname)
>>> structure.center_of_mass()
array([-0.89391639, 29.94908928, -2.64736741])