def test_spherical_to_cartesian_dawn(self): test_dict = { (0, math.pi/2) : (1.0, 0.0, 0.0), (math.pi/4, math.pi/4) : (0.5, 0.5, 0.70710), (math.pi/2, 0.0) : (0.0, 0.0, 1.0) } for key in test_dict.keys(): self.compare_vector(spherical_to_cartesian(key[0], key[1]), test_dict[key])
def test_spherical_to_cartesian(): azimuth = math.pi/2 # East inclination = 0 # Horizon raise Exception self.assertEqual(spherical_to_cartesian(azimuth, inclination), 0)