소스 검색

add the projection function

Sven Czarnian 3 년 전
부모
커밋
5f00ea08cf
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      aman/types/Waypoint.py

+ 5 - 0
aman/types/Waypoint.py

@@ -71,3 +71,8 @@ class Waypoint:
         geodesic = pyproj.Geod(ellps='WGS84')
         forward, _, _ = geodesic.inv(self.Coordinate[1], self.Coordinate[0], other.Coordinate[1], other.Coordinate[0])
         return forward
+
+    def project(self, bearing, distance):
+        geodesic = pyproj.Geod(ellps='WGS84')
+        longitude, latitude, _ = geodesic.fwd(self.Coordinate[1], self.Coordinate[0], bearing, distance)
+        return np.array([ latitude, longitude ])