This is a read-only mirror of pymolwiki.org

Centerofmass

From PyMOL Wiki
Revision as of 00:06, 17 October 2016 by Cchem (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The centerofmass command calculates the center of mass for an atom selection. It considers atom mass and occupancy.

New in PyMOL 1.7.2. See the center_of_mass script for older PyMOL versions.

Usage

centerofmass [ selection [, state ]]

Arguments

  • selection = str: atom selection {default: all}
  • state = int: object state, -1 for current state, 0 for all states {default: -1}

Example

PyMOL> fetch 1ubq, async=0
PyMOL> centerofmass
 Center of Mass: [  30.004,  28.522,  14.701]

Python API

cmd.centerofmass() returns a list of 3 floats.

See Also