add the projection function

This commit is contained in:
Sven Czarnian
2021-11-24 12:03:44 +01:00
parent c767572dee
commit 5f00ea08cf

View File

@@ -71,3 +71,8 @@ class Waypoint:
geodesic = pyproj.Geod(ellps='WGS84') geodesic = pyproj.Geod(ellps='WGS84')
forward, _, _ = geodesic.inv(self.Coordinate[1], self.Coordinate[0], other.Coordinate[1], other.Coordinate[0]) forward, _, _ = geodesic.inv(self.Coordinate[1], self.Coordinate[0], other.Coordinate[1], other.Coordinate[0])
return forward 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 ])