# -----------------------------------------------------------------------------
# Report all angles made by bonds originating from selected atoms.
#
from chimera import selection, angle
atoms = selection.currentAtoms()
print '%d atoms selected' % len(atoms)
c = 0
for a in atoms:
    bonds = a.bonds
    for b1 in bonds:
        for b2 in bonds:
            if b1 < b2:
                a1 = b1.otherAtom(a)
                a2 = b2.otherAtom(a)
                t = angle(a1.coord(), a.coord(), a2.coord())
                print ('Angle %s %s %s = %.3f degrees' %
                       (a1.oslIdent(), a.oslIdent(), a2.oslIdent(), t))
                c += 1
print '%d angles reported' % c

import Accelerators.standard_accelerators as sa
sa.show_reply_log()
