def get_transformation(self, coordinates):
atom1, atom2, atom3 = self.hinge_atoms<EOL>center = coordinates[atom2]<EOL>a = coordinates[atom1] - coordinates[atom2]<EOL>b = coordinates[atom3] - coordinates[atom2]<EOL>axis = np.cross(a, b)<EOL>norm = np.linalg.norm(axis)<EOL>if norm < <NUM_LIT>:<EOL><INDENT>axis = random_orthonormal(a)<EOL><DEDENT>else:<EOL><INDENT>axis /= np.linalg.norm(axis)<EOL><DEDENT>angle = np.random.uniform(-self.max_amplitude, self.max_amplitude)<EOL>return Complete.about_axis(center, angle, axis)<EOL>
Construct a transformation object