]> git.mxchange.org Git - flightgear.git/commitdiff
NaN fix by Csaba/Jester - prefer atan2(x,y) to atan(a/y).
authorjmt <jmt>
Fri, 2 Jan 2009 12:34:28 +0000 (12:34 +0000)
committerTim Moore <timoore@redhat.com>
Sat, 3 Jan 2009 23:24:33 +0000 (00:24 +0100)
src/AIModel/AICarrier.cxx

index 1a9a1d2b72dc51fddfadfd4ed221ca26b474a3c7..979e9710bc471eb49e562201eaa5ff7745c15ffa 100644 (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