Extend Magvar interface to use SGGeod.

This commit is contained in:
James Turner 2010-06-17 21:39:10 +01:00
parent cc9b817f0e
commit b846e33ee3
2 changed files with 12 additions and 1 deletions

View File

@ -50,7 +50,7 @@ void SGMagVar::update( double lon, double lat, double alt_m, double jd ) {
void SGMagVar::update( const SGGeod& geod, double jd ) { void SGMagVar::update( const SGGeod& geod, double jd ) {
update(geod.getLongitudeDeg(), geod.getLatitudeDeg(), update(geod.getLongitudeRad(), geod.getLatitudeRad(),
geod.getElevationM(), jd); geod.getElevationM(), jd);
} }
@ -62,3 +62,10 @@ double sgGetMagVar( double lon, double lat, double alt_m, double jd ) {
double field[6]; double field[6];
return calc_magvar( lat, lon, alt_m / 1000.0, (long)jd, field ); 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);
}

View File

@ -103,5 +103,9 @@ public:
*/ */
double sgGetMagVar( double lon, double lat, double alt_m, double jd ); double sgGetMagVar( double lon, double lat, double alt_m, double jd );
/**
* overload version of the above to take a SGGeod
*/
double sgGetMagVar( const SGGeod& pos, double jd );
#endif // _MAGVAR_HXX #endif // _MAGVAR_HXX