]> git.mxchange.org Git - simgear.git/blobdiff - simgear/math/polar3d.cxx
Allow removing of the texture data after it is sent to OpenGL
[simgear.git] / simgear / math / polar3d.cxx
index 1b6c2b0aba65359ff79a9a0b67fe8f750b14cc40..6b1e2e79d923fe68253766aedef7c3e85ab5d024 100644 (file)
@@ -4,19 +4,20 @@
 //
 // Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
 //
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of the
-// License, or (at your option) any later version.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
 //
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// General Public License for more details.
+// Library General Public License for more details.
 //
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA  02111-1307, USA.
 //
 // $Id$
 
@@ -38,17 +39,17 @@ double fgGeodAltFromCart(const Point3D& cp)
     double lat_geoc, radius;
     double result;
 
-    lat_geoc = FG_PI_2 - atan2( sqrt(cp.x()*cp.x() + cp.y()*cp.y()), cp.z() );
+    lat_geoc = SGD_PI_2 - atan2( sqrt(cp.x()*cp.x() + cp.y()*cp.y()), cp.z() );
     radius = sqrt( cp.x()*cp.x() + cp.y()*cp.y() + cp.z()*cp.z() );
        
-    if( ( (FG_PI_2 - lat_geoc) < ONE_SECOND )        // near North pole
-       || ( (FG_PI_2 + lat_geoc) < ONE_SECOND ) )   // near South pole
+    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;
        }