From 5f00ea08cf9ca288c65a993c6bbfc97c9670dee9 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Wed, 24 Nov 2021 12:03:44 +0100 Subject: [PATCH] add the projection function --- aman/types/Waypoint.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aman/types/Waypoint.py b/aman/types/Waypoint.py index 1e5272b..e798a93 100644 --- a/aman/types/Waypoint.py +++ b/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 ])