1
0
Fork 0

No need to do he calculations twice. FGAIBAse::update() handles them already.

This commit is contained in:
ehofman 2004-06-12 11:34:05 +00:00
parent 24820e6d5a
commit c43e514e87
3 changed files with 1 additions and 22 deletions

View file

@ -81,12 +81,6 @@ void FGAIBallistic::Run(double dt) {
double speed_north_deg_sec; double speed_north_deg_sec;
double speed_east_deg_sec; double speed_east_deg_sec;
double ft_per_deg_lon;
double ft_per_deg_lat;
// get size of a degree at this latitude
ft_per_deg_lat = 366468.96 - 3717.12 * cos(pos.lat()/SG_RADIANS_TO_DEGREES);
ft_per_deg_lon = 365228.16 * cos(pos.lat() / SG_RADIANS_TO_DEGREES);
// the two drag calculations below assume sea-level density, // the two drag calculations below assume sea-level density,
// mass of 0.03 slugs, drag coeff of 0.295, frontal area of 0.007 ft2 // mass of 0.03 slugs, drag coeff of 0.295, frontal area of 0.007 ft2

View file

@ -72,15 +72,9 @@ void FGAIShip::Run(double dt) {
double turn_circum_ft; double turn_circum_ft;
double speed_north_deg_sec; double speed_north_deg_sec;
double speed_east_deg_sec; double speed_east_deg_sec;
double ft_per_deg_lon;
double ft_per_deg_lat;
double dist_covered_ft; double dist_covered_ft;
double alpha; double alpha;
// get size of a degree at this latitude
ft_per_deg_lat = 366468.96 - 3717.12 * cos(pos.lat()/SG_RADIANS_TO_DEGREES);
ft_per_deg_lon = 365228.16 * cos(pos.lat() / SG_RADIANS_TO_DEGREES);
// adjust speed // adjust speed
double speed_diff = tgt_speed - speed; double speed_diff = tgt_speed - speed;
if (fabs(speed_diff) > 0.1) { if (fabs(speed_diff) > 0.1) {

View file

@ -73,15 +73,6 @@ void FGAIThermal::Run(double dt) {
FGAIThermal::dt = dt; FGAIThermal::dt = dt;
double ft_per_deg_lon;
double ft_per_deg_lat;
// get size of a degree at this latitude
ft_per_deg_lat = 366468.96 - 3717.12 * cos(pos.lat()/SG_RADIANS_TO_DEGREES);
ft_per_deg_lon = 365228.16 * cos(pos.lat() / SG_RADIANS_TO_DEGREES);
// double altitude_ft = altitude * SG_METER_TO_FEET;
//###########################// //###########################//
// do calculations for range // // do calculations for range //
//###########################// //###########################//
@ -94,7 +85,7 @@ void FGAIThermal::Run(double dt) {
// calculate range to target in feet and nautical miles // calculate range to target in feet and nautical miles
double lat_range = fabs(pos.lat() - user_latitude) * ft_per_deg_lat; double lat_range = fabs(pos.lat() - user_latitude) * ft_per_deg_lat;
double lon_range = fabs(pos.lon() - user_longitude) * ft_per_deg_lon; double lon_range = fabs(pos.lon() - user_longitude) * ft_per_deg_lon;
double range_ft = sqrt( lat_range*lat_range + lon_range*lon_range ); double range_ft = lat_range*lat_range + lon_range*lon_range;
range = range_ft / 6076.11549; range = range_ft / 6076.11549;
// Calculate speed of rising air if within range. // Calculate speed of rising air if within range.