#include <stdlib.h>
#include <math.h>
-#include "magvar.hxx"
+#include <simgear/constants.h>
+
+#include "coremag.hxx"
int main(int argc, char *argv[])
}
-var = SGMagVar( deg_to_rad(lat_deg), deg_to_rad(lon_deg), h,
- yymmdd_to_julian_days(yy,mm,dd), field );
+var = calc_magvar( DEG_TO_RAD * lat_deg, DEG_TO_RAD * lon_deg, h,
+ yymmdd_to_julian_days(yy,mm,dd), field );
+fprintf(stdout,"%6.0lf %6.0lf %6.0lf\n", field[0], field[1], field[2] );
+fprintf(stdout,"%6.0lf %6.0lf %6.0lf\n", field[3], field[4], field[5] );
fprintf(stdout,"%6.0lf %6.0lf %6.0lf %4.2lf %4.2lf \n",
field[3],field[4],field[5],
- rad_to_deg(atan(field[5]/pow(field[3]*field[3]+field[4]*field[4],0.5))),var);
+ RAD_TO_DEG * (atan(field[5]/pow(field[3]*field[3]+field[4]*field[4],0.5))),
+ RAD_TO_DEG * var);
exit(0);
}