-// convert a geodetic point lon(arcsec), lat(arcsec), elev(meter) to a
-// cartesian point
-fgPoint3d geod_to_cart(fgPoint3d geod) {
- fgPoint3d cp;
- fgPoint3d pp;
- double gc_lon, gc_lat, sl_radius;
-
- // printf("A geodetic point is (%.2f, %.2f, %.2f)\n",
- // geod[0], geod[1], geod[2]);
-
- gc_lon = geod.lon * ARCSEC_TO_RAD;
- fgGeodToGeoc(geod.lat * ARCSEC_TO_RAD, geod.radius, &sl_radius, &gc_lat);
-
- // printf("A geocentric point is (%.2f, %.2f, %.2f)\n", gc_lon,
- // gc_lat, sl_radius+geod[2]);
-
- pp.lon = gc_lon;
- pp.lat = gc_lat;
- pp.radius = sl_radius + geod.radius;
- cp = fgPolarToCart3d(pp);
-
- // printf("A cart point is (%.8f, %.8f, %.8f)\n", cp.x, cp.y, cp.z);
-
- return(cp);
-}
-