# Chimera script to print symmetry matrices for GroEL 14-mer.

format =  '''REMARK 350   BIOMT1   %3d  %10.6f %10.6f %10.6f %10.6f
REMARK 350   BIOMT2   %3d  %10.6f %10.6f %10.6f %10.6f
REMARK 350   BIOMT3   %3d  %10.6f %10.6f %10.6f %10.6f'''

axis = (0,0,1)
import Matrix as m
flip = m.rotation_from_axis_angle((1,0,0), 180)  # 180 degree rotation about x.
flip = [r + (0,) for r in flip]                  # Zero translation.
for i in range(14):
  a = 360.0*i/7.0
  t = m.rotation_from_axis_angle(axis, a)  # Rotation by i/7 turn about z.
  t = [r + (0,) for r in t]                # Zero translation.
  if i >= 7:
    t = m.multiply_matrices(flip, t)       # Exchange top and bottom ring.
  print format % ((i,) + t[0] + (i,) + t[1] + (i,) + t[2])
