X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fmagvar%2Fmagvar.cxx;h=43563a71b6f2c3d919156c192e1bb1e639fb9003;hb=5f804cb0eb126ab7162855dad14d20eb381309c6;hp=095c9718eb037fda46c7b13ec4854c276ed53a38;hpb=0ad66f4bc48d04df39b0d3ed6e6a60fdee1dd21d;p=simgear.git diff --git a/simgear/magvar/magvar.cxx b/simgear/magvar/magvar.cxx index 095c9718..43563a71 100644 --- a/simgear/magvar/magvar.cxx +++ b/simgear/magvar/magvar.cxx @@ -21,6 +21,11 @@ // $Id$ +#ifdef HAVE_CONFIG_H +# include +#endif + + #include #include @@ -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); +} +