def test_cubochoric(self, set_of_rotations, P): for rot in set_of_rotations: m = rot.as_homochoric() o = Rotation.from_cubochoric(rot.as_cubochoric() * P * -1, P).as_homochoric() ok = np.allclose(m, o, atol=atol) assert ok and np.linalg.norm(o) < (3. * np.pi / 4.)**( 1. / 3.) + 1.e-9, f'{m},{o},{rot.as_quaternion()}'
def test_cubochoric(self, default, P): for rot in default: m = rot.as_homochoric() o = Rotation.from_cubochoric(rot.as_cubochoric() * P * -1, P).as_homochoric() ok = np.allclose(m, o, atol=atol) print(m, o, rot.as_quaternion()) assert ok and np.linalg.norm(o) < (3. * np.pi / 4.)**(1. / 3.) + 1.e-9