]> git.mxchange.org Git - simgear.git/blobdiff - simgear/magvar/magvar.cxx
Add another subsystem group.
[simgear.git] / simgear / magvar / magvar.cxx
index 095c9718eb037fda46c7b13ec4854c276ed53a38..43563a71b6f2c3d919156c192e1bb1e639fb9003 100644 (file)
 // $Id$
 
 
+#ifdef HAVE_CONFIG_H
+#  include <simgear_config.h>
+#endif
+
+
 #include <math.h>
 
 #include <simgear/magvar/magvar.hxx>
@@ -50,7 +55,7 @@ void SGMagVar::update( double lon, double lat, double alt_m, double jd ) {
 
 void SGMagVar::update( const SGGeod& geod, double jd ) {
 
-  update(geod.getLongitudeDeg(), geod.getLatitudeDeg(),
+  update(geod.getLongitudeRad(), geod.getLatitudeRad(),
     geod.getElevationM(), jd);
 }
 
@@ -62,3 +67,10 @@ double sgGetMagVar( double lon, double lat, double alt_m, double jd ) {
     double field[6];
     return calc_magvar( lat, lon, alt_m / 1000.0, (long)jd, field );
 }
+
+double sgGetMagVar( const SGGeod& pos, double jd )
+{
+  return sgGetMagVar(pos.getLongitudeRad(), pos.getLatitudeRad(), 
+    pos.getElevationM(), jd);
+}
+