+double
+SGGeodesy::courseDeg(const SGGeod& p1, const SGGeod& p2)
+{
+ double course1, course2, distance;
+ int r = _geo_inverse_wgs_84(p1.getLatitudeDeg(), p1.getLongitudeDeg(),
+ p2.getLatitudeDeg(), p2.getLongitudeDeg(),
+ &course1, &course2, &distance);
+ if (r != 0) {
+ throw sg_exception("SGGeodesy::courseDeg, unable to compute course");
+ }
+
+ return course1;
+}
+
+double
+SGGeodesy::distanceM(const SGGeod& p1, const SGGeod& p2)
+{
+ double course1, course2, distance;
+ int r = _geo_inverse_wgs_84(p1.getLatitudeDeg(), p1.getLongitudeDeg(),
+ p2.getLatitudeDeg(), p2.getLongitudeDeg(),
+ &course1, &course2, &distance);
+ if (r != 0) {
+ throw sg_exception("SGGeodesy::distanceM, unable to compute distance");
+ }
+
+ return distance;
+}
+
+double
+SGGeodesy::distanceNm(const SGGeod& from, const SGGeod& to)
+{
+ return distanceM(from, to) * SG_METER_TO_NM;
+}
+