def get_transformation(self, coordinates):
atom1, atom2, atom3, atom4 = self.hinge_atoms<EOL>a = coordinates[atom1] - coordinates[atom2]<EOL>a /= np.linalg.norm(a)<EOL>b = coordinates[atom3] - coordinates[atom4]<EOL>b /= np.linalg.norm(b)<EOL>direction = <NUM_LIT:0.5>*(a+b)<EOL>direction *= np.random.uniform(-self.max_amplitude, self.max_amplitude)<EOL>result = Translation(direction)<EOL>return result<EOL>
Construct a transformation object