]> git.mxchange.org Git - flightgear.git/blobdiff - tests/test-up.cxx
JSBSim change:
[flightgear.git] / tests / test-up.cxx
index d5ae7c1b16a0dcf301c543c4ace13dcb0604c689..e9671ee1fd9133a4e9ad85fab53b2f05202544cd 100644 (file)
@@ -1,12 +1,19 @@
 // do some test relating to the concept of "up"
 
-#include <iostream>
+#include <simgear/compiler.h>
+
+#include STL_IOSTREAM
 
 #include <plib/sg.h>
 
 #include <simgear/constants.h>
 #include <simgear/math/sg_geodesy.hxx>
 
+#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
+SG_USING_STD(cout);
+SG_USING_STD(endl);
+#endif
+
 int main() {
     // for each lat/lon given in goedetic coordinates, calculate
     // geocentric coordinates, cartesian coordinates, the local "up"
@@ -21,24 +28,24 @@ int main() {
        cout << "lon = " << lon << "  geod lat = " << lat;
 
        double sl_radius, lat_geoc;
-       sgGeodToGeoc( lat * DEG_TO_RAD, alt, &sl_radius, &lat_geoc );
-       cout << "  geoc lat = " << lat_geoc * RAD_TO_DEG << endl;
+       sgGeodToGeoc( lat * SGD_DEGREES_TO_RADIANS, alt, &sl_radius, &lat_geoc );
+       cout << "  geoc lat = " << lat_geoc * SGD_RADIANS_TO_DEGREES << endl;
 
-       Point3D pgd( lon * DEG_TO_RAD, lat * DEG_TO_RAD, 0.0 );
+       Point3D pgd( lon * SGD_DEGREES_TO_RADIANS, lat * SGD_DEGREES_TO_RADIANS, 0.0 );
        Point3D pc = sgGeodToCart( pgd );
        cout << "  cartesian = " << pc << endl;
 
-       sgMat4 GEOD_UP;
-       sgVec3 geod_up;
-       sgMakeRotMat4( GEOD_UP, lon, 0.0, -lat );
-       sgSetVec3( geod_up, GEOD_UP[0][0], GEOD_UP[0][1], GEOD_UP[0][2] );
+       sgdMat4 GEOD_UP;
+       sgdVec3 geod_up;
+       sgdMakeRotMat4( GEOD_UP, lon, 0.0, -lat );
+       sgdSetVec3( geod_up, GEOD_UP[0][0], GEOD_UP[0][1], GEOD_UP[0][2] );
        cout << "  geod up = " << geod_up[0] << ", " << geod_up[1] << ", "
             << geod_up[2] << endl;
 
-       sgMat4 GEOC_UP;
-       sgVec3 geoc_up;
-       sgMakeRotMat4( GEOC_UP, lon, 0.0, -lat_geoc * RAD_TO_DEG );
-       sgSetVec3( geoc_up, GEOC_UP[0][0], GEOC_UP[0][1], GEOC_UP[0][2] );
+       sgdMat4 GEOC_UP;
+       sgdVec3 geoc_up;
+       sgdMakeRotMat4( GEOC_UP, lon, 0.0, -lat_geoc * SGD_RADIANS_TO_DEGREES );
+       sgdSetVec3( geoc_up, GEOC_UP[0][0], GEOC_UP[0][1], GEOC_UP[0][2] );
        cout << "  geoc up = " << geoc_up[0] << ", " << geoc_up[1] << ", "
             << geoc_up[2] << endl;