From 01ab3b2385aa5c62653c662722dba2ecf27c1cc5 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sat, 30 May 2020 16:27:42 +0100 Subject: [PATCH] New SGGeodesy::advance, taking degrees --- simgear/math/SGGeodesy.cxx | 7 +++++++ simgear/math/SGGeodesy.hxx | 3 +++ 2 files changed, 10 insertions(+) diff --git a/simgear/math/SGGeodesy.cxx b/simgear/math/SGGeodesy.cxx index 6fe5bcdf..6949a526 100644 --- a/simgear/math/SGGeodesy.cxx +++ b/simgear/math/SGGeodesy.cxx @@ -537,6 +537,13 @@ SGGeodesy::advanceRadM(const SGGeoc& geoc, double course, double distance, } } +SGGeoc SGGeodesy::advanceDegM(const SGGeoc &geoc, double course, + double distance) { + SGGeoc result; + advanceRadM(geoc, course * SG_DEGREES_TO_RADIANS, distance, result); + return result; +} + double SGGeodesy::courseRad(const SGGeoc& from, const SGGeoc& to) { diff --git a/simgear/math/SGGeodesy.hxx b/simgear/math/SGGeodesy.hxx index cce38199..6a74eadd 100644 --- a/simgear/math/SGGeodesy.hxx +++ b/simgear/math/SGGeodesy.hxx @@ -65,6 +65,9 @@ public: // Geocentric course/distance computation static void advanceRadM(const SGGeoc& geoc, double course, double distance, SGGeoc& result); + + static SGGeoc advanceDegM(const SGGeoc &geoc, double course, double distance); + static double courseRad(const SGGeoc& from, const SGGeoc& to); static double distanceRad(const SGGeoc& from, const SGGeoc& to); static double distanceM(const SGGeoc& from, const SGGeoc& to);