コード例 #1
0
ファイル: sphere_math_test.py プロジェクト: sconover/oogway
    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))
コード例 #2
0
ファイル: sphere_math_test.py プロジェクト: sconover/oogway
 def test_angles(self):
     self.assertEqual(Position(0, 0.707, 0.707), calculate_point_on_sphere(Direction(0,-45,0), 1))