def test_basics(self): self.assertEqual(Position(0, 0, -1), calculate_point_on_sphere(NORTH_HORIZON, 1)) self.assertEqual(Position(1, 0, 0), calculate_point_on_sphere(EAST_HORIZON, 1)) self.assertEqual(Position(0, 0, 1), calculate_point_on_sphere(SOUTH_HORIZON, 1)) self.assertEqual(Position(-1, 0, 0), calculate_point_on_sphere(WEST_HORIZON, 1)) # alternative north self.assertEqual(Position(0, 0, 1), calculate_point_on_sphere(Direction(-180,0,0), 1)) self.assertEqual(Position(0, 1, 0), calculate_point_on_sphere(STRAIGHT_UP, 1)) self.assertEqual(Position(0, -1, 0), calculate_point_on_sphere(STRAIGHT_DOWN, 1))
def test_angles(self): self.assertEqual(Position(0, 0.707, 0.707), calculate_point_on_sphere(Direction(0,-45,0), 1))