Explorar o código

add the projection function

Sven Czarnian %!s(int64=3) %!d(string=hai) anos
pai
achega
5f00ea08cf
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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 ])