This is a read-only mirror of pymolwiki.org

Centroid

From PyMOL Wiki
Revision as of 22:59, 14 September 2015 by OsvaldoMartin (talk | contribs) (moved Com to Centroid)
Jump to navigation Jump to search
Type Python Module
Download centroid.py
Author(s) Jason Vertrees
License BSD
This code has been put under version control in the project Pymol-script-repo

Overview

Centroid is a small script that returns the value of the geometric center (or centroid) of your selection. It also can translate the object of that selection to the origin.

Syntax

centroid (selection=PyMOLSelection), [center=boolean]

Examples

# get the centroid of the polymer
import centroid
fetch 4ins, async=0
centroid polymer

# move some 'ligand' to the origin
centroid ligand, center=1

See Also

Center_Of_Mass