# [Chimera-users] making a plane through the atoms of a ring and Distance measurements

Greg Couch gregc at cgl.ucsf.edu
Tue Jun 3 12:54:15 PDT 2008

```On Mon, 2 Jun 2008, David Chenoweth wrote:

> Dear Chimera team,
>
> I would like to make a plane through the atoms of an aromatic ring and
> then measure a distance from an atom to the ring centroid. I would
> also like to measure the angle between the normal to the ring plane
> and the line joining the centroid and the atom I am measuring from. It
> would also be nice if I could specify the dimensions, color, and
> transparency of the plane. In addition it would be great to be able to
> make multiple planes through atoms, select and color them separately,
> and measure the angles at the intersection of the planes. Just
> wondering if there is a way to do this with Chimera.
>
> Dave

This sort of thing currently requires writing Python code.  For example,
if you selected a ring by hand, the following code computes the plane.
The plane's origin is the centroid of the atoms:

from chimera import selection, Plane
atoms = selection.currentAtoms()
plane = Plane([a.coord() for a in atoms])

To calculate the plane equation, chimera uses Newell's method, so points
should be given in ring order, but the ring doesn't have to be convex.
If you computed a least-squared fit plane, the answer would be slightly
different.

To measure the angle between two planes, just calculate the angle between
their normals (arccos of the (normalized) dot product).

To visualize the results, I'd recommend creating a SurfaceModel from the
_surface module.

Since much of chimera is implemented in Python, "example" code that uses
chimera Planes and SurfaceModels can be found the Python modules in the
CHIMERA/share directory.  Specifically, the NucleicAcids and GraspSurface
modules.

To get started programming chimera with Python, please look at the
tutorials in the Chimera Programmer's Guide,
<http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html>.  And
if you have any programming questions, please ask them on the chimera
developer's mailing list, chimera-dev at cgl.ucsf.edu.

Good luck,

Greg Couch
UCSF Computer Graphics Lab

```