X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fmath%2FSGGeodesy.hxx;h=060bf4d3f50ae98a51438805551ceb7121ad34e3;hb=cc9b817f0e20a879cd23ce7f8014b2dc6a5d493e;hp=8f8bf4a69928d6709669a71870690913aa7783a4;hpb=dcb95d131bc6aef1abe25d1f415e309f06e52436;p=simgear.git diff --git a/simgear/math/SGGeodesy.hxx b/simgear/math/SGGeodesy.hxx index 8f8bf4a6..060bf4d3 100644 --- a/simgear/math/SGGeodesy.hxx +++ b/simgear/math/SGGeodesy.hxx @@ -18,12 +18,6 @@ #ifndef SGGeodesy_H #define SGGeodesy_H -class SGGeoc; -class SGGeod; - -template -class SGVec3; - class SGGeodesy { public: // Hard numbers from the WGS84 standard. @@ -51,6 +45,34 @@ public: /// Takes a geocentric coordinate data and returns the cartesian /// coordinates. static void SGGeocToCart(const SGGeoc& geoc, SGVec3& cart); + + // Geodetic course/distance computation + static bool direct(const SGGeod& p1, double course1, + double distance, SGGeod& p2, double& course2); + + static bool inverse(const SGGeod& p1, const SGGeod& p2, double& course1, + double& course2, double& distance); + + static double courseDeg(const SGGeod& from, const SGGeod& to); + static double distanceM(const SGGeod& from, const SGGeod& to); + static double distanceNm(const SGGeod& from, const SGGeod& to); + + // Geocentric course/distance computation + static void advanceRadM(const SGGeoc& geoc, double course, double distance, + SGGeoc& result); + 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); + + /** + * compute the intersection of two (true) radials (in degrees), or return false + * if no intersection culd be computed. + */ + static bool radialIntersection(const SGGeoc& a, double aRadial, + const SGGeoc& b, double bRadial, SGGeoc& result); + + static bool radialIntersection(const SGGeod& a, double aRadial, + const SGGeod& b, double bRadial, SGGeod& result); }; #endif