mass_center#
- biotite.structure.mass_center(array: AtomArray[N] | AtomArrayStack[M, N], masses: ndarray[tuple[N], dtype[floating]] | None = None) ndarray[tuple[XYZ], dtype[floating]] | ndarray[tuple[M, XYZ], dtype[floating]][source]#
Calculate the center(s) of mass of an atom array or stack.
- Parameters:
- arrayAtomArray or AtomArrayStack
The array or stack to calculate the center(s) of mass for.
- massesndarray, optional
The masses to use for each atom in the input array. Must have the same length as array. By default, the standard atomic mass for each element is taken.
- Returns:
- radiusndarray, ndarray, dtype=float
Array containing the the coordinates of the center of mass. If array is an
AtomArray, this will be an length 3ndarray; if it is anAtomArrayStackwith n models, a (n x 3)ndarrayis returned.