]> git.mxchange.org Git - simgear.git/blob - Lib/Math/geotest.c
Fixed an IRIX warning message where an inline function is referenced
[simgear.git] / Lib / Math / geotest.c
1 #include <Include/fg_constants.h>
2 #include <Math/fg_geodesy.h>
3
4 #include <stdio.h>
5
6 void
7 main( void )
8 {
9     double Lon, Alt, sl_radius;
10     double geodetic_Lat;
11     double geocentric_Lat;
12
13     Lon          = -87.75 * DEG_TO_RAD;
14     geodetic_Lat =  41.83 * DEG_TO_RAD;
15     Alt          = 1.5; /* km */
16
17     printf("Geodetic position = (%.8f, %.8f, %.8f)\n", Lon, geodetic_Lat, Alt); 
18
19     fgGeodToGeoc( geodetic_Lat, Alt, &sl_radius, &geocentric_Lat );
20
21     printf("Geocentric position = (%.8f, %.8f, %.8f)\n", Lon, geocentric_Lat, 
22            sl_radius + Alt); 
23     printf("new sl_radius = %.8f\n", sl_radius); 
24
25     fgGeocToGeod( geocentric_Lat, sl_radius + Alt, &geodetic_Lat,
26                      &Alt, &sl_radius );
27
28     printf("Geodetic position = (%.8f, %.8f, %.8f)\n", Lon, geodetic_Lat, Alt); 
29     printf("new sl_radius = %.8f\n", sl_radius); 
30 }