"runway = " << found_r.lon << ", " << found_r.lat
<< " length = " << found_r.length * FEET_TO_METER * 0.5
<< " heading = " << azimuth );
+
geo_direct_wgs_84 ( 0, found_r.lat, found_r.lon,
azimuth, found_r.length * FEET_TO_METER * 0.5 - 5.0,
&lat2, &lon2, &az2 );
+
+ if ( fabs( fgGetDouble("/sim/startup/offset-distance") ) > FG_EPSILON ) {
+ double olat, olon;
+ double odist = fgGetDouble("/sim/startup/offset-distance");
+ odist *= NM_TO_METER;
+ double oaz = azimuth;
+ if ( fabs(fgGetDouble("/sim/startup/offset-azimuth")) > FG_EPSILON ) {
+ oaz = fgGetDouble("/sim/startup/offset-azimuth") + 180;
+ }
+ while ( oaz >= 360.0 ) { oaz -= 360.0; }
+ geo_direct_wgs_84 ( 0, lat2, lon2, oaz, odist, &olat, &olon, &az2 );
+ lat2=olat;
+ lon2=olon;
+ }
fgSetDouble("/position/longitude", lon2 );
fgSetDouble("/position/latitude", lat2 );
fgSetDouble("/orientation/heading", heading );
} else if ( arg.find( "--airport-id=") != string::npos ) {
// NB: changed property name!!!
fgSetString("/sim/startup/airport-id", arg.substr(13));
+ } else if ( arg.find( "--offset-distance=") != string::npos ) {
+ fgSetDouble("/sim/startup/offset-distance", atof(arg.substr(18)));
+ } else if ( arg.find( "--offset-azimuth=") != string::npos ) {
+ fgSetDouble("/sim/startup/offset-azimuth", atof(arg.substr(17)));
} else if ( arg.find( "--lon=" ) != string::npos ) {
fgSetDouble("/position/longitude",
parse_degree(arg.substr(6)));
cout << "Initial Position and Orientation:" << endl;
cout << "\t--airport-id=ABCD: specify starting postion by airport id"
<< endl;
+ cout << "\t--offset-distance: specify distance to threshhold"
+ << " (NM)" << endl;
+ cout << "\t--offset-azimuth: specify heading to threshhold (deg) "
+ << endl;
cout << "\t--lon=degrees: starting longitude in degrees (west = -)"
<< endl;
cout << "\t--lat=degrees: starting latitude in degrees (south = -)"