]> git.mxchange.org Git - simgear.git/blobdiff - simgear/math/polar3d.cxx
Update the code a bit more, add a function to retreive the last error string and...
[simgear.git] / simgear / math / polar3d.cxx
index be9240297387034b6930a5cf36c1075527246de3..1502f3a804367489d9f29d4db22b8ad780bcff7c 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Written by Curtis Olson, started June 1997.
 //
-// Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+// Copyright (C) 1997  Curtis L. Olson  - http://www.flightgear.org/~curt
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Library General Public
@@ -45,11 +45,11 @@ double fgGeodAltFromCart(const Point3D& cp)
     if( ( (SGD_PI_2 - lat_geoc) < SG_ONE_SECOND )        // near North pole
        || ( (SGD_PI_2 + lat_geoc) < SG_ONE_SECOND ) )   // near South pole
     {
-       result = radius - EQUATORIAL_RADIUS_M*E;
+       result = radius - SG_EQUATORIAL_RADIUS_M*E;
     } else {
        t_lat = tan(lat_geoc);
-       x_alpha = E*EQUATORIAL_RADIUS_M/sqrt(t_lat*t_lat + E*E);
-       mu_alpha = atan2(sqrt(RESQ_M - x_alpha*x_alpha),E*x_alpha);
+       x_alpha = E*SG_EQUATORIAL_RADIUS_M/sqrt(t_lat*t_lat + E*E);
+       mu_alpha = atan2(sqrt(SG_EQ_RAD_SQUARE_M - x_alpha*x_alpha),E*x_alpha);
        if (lat_geoc < 0) {
            mu_alpha = - mu_alpha;
        }