1
0
Fork 0

NaN fix by Csaba/Jester - prefer atan2(x,y) to atan(a/y).

This commit is contained in:
jmt 2009-01-02 12:34:28 +00:00 committed by Tim Moore
parent fd043ed56e
commit 1a05695ff5

View file

@ -514,7 +514,7 @@ void FGAICarrier::UpdateWind( double dt) {
+ (rel_wind_speed_from_north_kts * rel_wind_speed_from_north_kts));
//calculate the relative wind direction
rel_wind_from_deg = atan(rel_wind_speed_from_east_kts/rel_wind_speed_from_north_kts)
rel_wind_from_deg = atan2(rel_wind_speed_from_east_kts, rel_wind_speed_from_north_kts)
* SG_RADIANS_TO_DEGREES;
// rationalise the output