def test_coords_to_spherical_with_sixth_octant(self): coords = np.array([-1, 3, -5]) expected_theta = 1.8925 expected_phi = 2.5777 epsilon = 4 spherical_coords = coords_to_spherical(coords=coords) theta = spherical_coords[0] phi = spherical_coords[1] self.assertAlmostEqual(expected_theta, theta, epsilon) self.assertAlmostEqual(expected_phi, phi, epsilon)
def test_coords_to_spherical_with_fourth_octant(self): coords = np.array([1, -3, 5]) expected_theta = 5.0341 expected_phi = 0.5639 epsilon = 4 spherical_coords = coords_to_spherical(coords=coords) theta = spherical_coords[0] phi = spherical_coords[1] self.assertAlmostEqual(expected_theta, theta, epsilon) self.assertAlmostEqual(expected_phi, phi, epsilon)