#include <math.h>
#include <simgear/magvar/magvar.hxx>
+#include <simgear/math/SGMath.hxx>
#include "coremag.hxx"
#include "magvar.hxx"
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
#endif
+// forward decls
+class SGGeod;
+
/**
* Magnetic variation wrapper class.
*
*/
void update( double lon, double lat, double alt_m, double jd );
+ /**
+ * overloaded variant taking an SGGeod to specify position
+ */
+ void update( const SGGeod& geod, double jd );
+
/** @return the current magnetic variation in radians. */
double get_magvar() const { return magvar; }