]> git.mxchange.org Git - simgear.git/blobdiff - simgear/magvar/magvar.cxx
Merge branch 'maint'
[simgear.git] / simgear / magvar / magvar.cxx
index 11f59b8b468a62c2e6c902b11332aeb09bac37b3..095c9718eb037fda46c7b13ec4854c276ed53a38 100644 (file)
@@ -24,6 +24,7 @@
 #include <math.h>
 
 #include <simgear/magvar/magvar.hxx>
+#include <simgear/math/SGMath.hxx>
 
 #include "coremag.hxx"
 #include "magvar.hxx"
@@ -47,6 +48,12 @@ void SGMagVar::update( double lon, double lat, double alt_m, double jd ) {
     magdip = atan(field[5]/sqrt(field[3]*field[3]+field[4]*field[4]));
 }
 
+void SGMagVar::update( const SGGeod& geod, double jd ) {
+
+  update(geod.getLongitudeDeg(), geod.getLatitudeDeg(),
+    geod.getElevationM(), jd);
+}
+
 
 double sgGetMagVar( double lon, double lat, double alt_m, double jd ) {
     // cout << "lat = " << lat << " lon = " << lon << " elev = " << alt_m