]> git.mxchange.org Git - simgear.git/blobdiff - simgear/magvar/coremag.cxx
Performance optimization: empty() instead of size()>0
[simgear.git] / simgear / magvar / coremag.cxx
index e7b868d3ea578f9f6c02c292910320e936f2b395..e6d42c1d1a5bf45341a2b476c19ea31ee9913337 100644 (file)
@@ -86,8 +86,6 @@
 
 #include "coremag.hxx"
 
-
-static const double pi = 3.14159265358979;
 static const double a = 6378.137;       /* semi-major axis (equatorial radius) of WGS84 ellipsoid */
 static const double b = 6356.7523142;   /* semi-minor axis referenced to the WGS84 ellipsoid */
 static const double r_0 = 6371.2;      /* standard Earth magnetic reference radius  */
@@ -325,7 +323,7 @@ double calc_magvar( double lat, double lon, double h, long dat, double* field )
     }
 
     /* Find geodetic field components: */
-    psi = theta - ((pi / 2.0) - lat);
+    psi = theta - ((M_PI / 2.0) - lat);
     sinpsi = sin(psi);
     cospsi = cos(psi);
     X = -B_theta * cospsi - B_r * sinpsi;