X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fcalc_loc.cxx;h=dd45e41c3820aa5e8205c61886e4ed3c7b584e10;hb=386aefe69358ce41a11c9afeb8f56e26758fe56b;hp=fe709c3d46c32ef03ba7b23a02f75fc4de1cbbd1;hpb=c538cc44fd441b27beb644dc3530b3e913f2d328;p=flightgear.git diff --git a/src/Airports/calc_loc.cxx b/src/Airports/calc_loc.cxx index fe709c3d4..dd45e41c3 100644 --- a/src/Airports/calc_loc.cxx +++ b/src/Airports/calc_loc.cxx @@ -1,21 +1,23 @@ // Calculate ILS heading +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include #include -#include STL_STRING - -#include +#include #include -SG_USING_STD(string); -SG_USING_STD(cout); -SG_USING_STD(endl); +using std::string; +using std::cout; +using std::endl; int main( int argc, char **argv ) { @@ -30,7 +32,7 @@ int main( int argc, char **argv ) { double rwy_lon = atof( argv[5] ); double rwy_hdg = atof( argv[6] ); double rwy_len = atof( argv[7] ) * SG_DEGREES_TO_RADIANS; - double rwy_wid = atof( argv[8] ); + // double rwy_wid = atof( argv[8] ); if ( dir == "FOR" ) { rwy_hdg += 180.0; @@ -40,7 +42,7 @@ int main( int argc, char **argv ) { } // calculate runway threshold point - double thresh_lat, thresh_lon, return_az; + double thresh_lat = 0.0, thresh_lon = 0.0, return_az = 0.0; geo_direct_wgs_84 ( 0.0, rwy_lat, rwy_lon, rwy_hdg, rwy_len / 2.0, &thresh_lat, &thresh_lon, &return_az ); cout << "Threshold = " << thresh_lat << "," << thresh_lon << endl; @@ -52,7 +54,7 @@ int main( int argc, char **argv ) { cout << "Distance = " << dist_m << endl; // back project that distance along the runway center line - double nloc_lat, nloc_lon; + double nloc_lat = 0.0, nloc_lon = 0.0; geo_direct_wgs_84 ( 0.0, thresh_lat, thresh_lon, rwy_hdg + 180.0, dist_m, &nloc_lat, &nloc_lon, &return_az ); printf("New localizer = %.6f %.6f\n", nloc_lat, nloc_lon );