X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fmagvar%2Fmagvar.cxx;h=43563a71b6f2c3d919156c192e1bb1e639fb9003;hb=04a47dfb8d96a58352b16658eb12d4aed90a97e8;hp=095c9718eb037fda46c7b13ec4854c276ed53a38;hpb=7fe40bce86ebd460d06ae8e76d3c64a6c9d58379;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); +} +