]> git.mxchange.org Git - simgear.git/commitdiff
Return result in radians.
authorcurt <curt>
Mon, 27 Mar 2000 22:30:11 +0000 (22:30 +0000)
committercurt <curt>
Mon, 27 Mar 2000 22:30:11 +0000 (22:30 +0000)
simgear/magvar/magvar.cxx
simgear/magvar/testmagvar.cxx

index 827ad04a33a392fca645993a9dbae738027c63f1..18ae58c1fe541ed99d0e0668e66ae567dfe21661 100644 (file)
@@ -271,7 +271,7 @@ double SGMagVar( double lat, double lon, double h, long dat, double* field )
     field[4]=Y;
     field[5]=Z;   /* output fields */
 
-    /* find variation, convert to degrees! */
-    return rad_to_deg(atan2(Y, X));  /* E is positive */
+    /* find variation, leave in radians! */
+    return atan2(Y, X);  /* E is positive */
 }
 
index 8f18b6d002776ec4deb78887778a82c47a3c69ed..1466745a91959b599080992c7562ecba03db4707 100644 (file)
@@ -43,9 +43,12 @@ if (argc == 8){
 var = SGMagVar( 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);
 }