コード例 #1
0
ファイル: test_frames.py プロジェクト: pbrod/Nvector
    def test_intersection_of_parallell_paths(self):

        # Two paths A and B are given by two pairs of positions:
        pointA1 = GeoPoint(10, 20, degrees=True)
        pointA2 = GeoPoint(30, 40, degrees=True)
        pointB1 = GeoPoint(10, 20, degrees=True)
        pointB2 = GeoPoint(30, 40, degrees=True)
        pathA = GeoPath(pointA1, pointA2)
        pathB = GeoPath(pointB1, pointB2)

        pointC = pathA.intersection(pathB)

        lat, lon = pointC.latitude_deg, pointC.longitude_deg
        msg = "Ex9, Intersection: lat, long = {} {} deg"
        print(msg.format(lat, lon))
        self.assertTrue(np.isnan(lat))
        self.assertTrue(np.isnan(lon))
コード例 #2
0
ファイル: test_frames.py プロジェクト: pbrod/Nvector
    def test_Ex9_intersection():

        # Two paths A and B are given by two pairs of positions:
        pointA1 = GeoPoint(10, 20, degrees=True)
        pointA2 = GeoPoint(30, 40, degrees=True)
        pointB1 = GeoPoint(50, 60, degrees=True)
        pointB2 = GeoPoint(70, 80, degrees=True)
        pathA = GeoPath(pointA1, pointA2)
        pathB = GeoPath(pointB1, pointB2)

        pointC = pathA.intersection(pathB)

        lat, lon = pointC.latitude_deg, pointC.longitude_deg
        msg = "Ex9, Intersection: lat, long = {} {} deg"
        print(msg.format(lat, lon))
        assert_array_almost_equal(lat, 40.31864307)
        assert_array_almost_equal(lon, 55.90186788)