mdtraj.compute_center_of_mass

mdtraj.compute_center_of_mass(traj, select=None)

Compute the center of mass for each frame.

Parameters
trajTrajectory

Trajectory to compute center of mass for

selectstr, optional, default=all

a mdtraj.Topology selection string that defines the set of atoms of which to calculate the center of mass, the default is all atoms

Returns
comnp.ndarray, shape=(n_frames, 3)

Coordinates of the center of mass for each frame