From 1a05695ff5bf34bdc407fa2647f07d4aca336204 Mon Sep 17 00:00:00 2001 From: jmt Date: Fri, 2 Jan 2009 12:34:28 +0000 Subject: [PATCH] NaN fix by Csaba/Jester - prefer atan2(x,y) to atan(a/y). --- src/AIModel/AICarrier.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AIModel/AICarrier.cxx b/src/AIModel/AICarrier.cxx index 1a9a1d2b7..979e9710b 100644 --- a/src/AIModel/AICarrier.cxx +++ b/src/AIModel/AICarrier.cxx @@ -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