From 3f35de950797ce93f30c85dd72c30e8a270453df Mon Sep 17 00:00:00 2001
From: andy <andy>
Date: Wed, 20 Feb 2002 07:09:21 +0000
Subject: [PATCH] Forgot to include the wind when computing airspeed.  Big
 oops.

---
 src/FDM/YASim/YASim.cxx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/FDM/YASim/YASim.cxx b/src/FDM/YASim/YASim.cxx
index 524fe004a..9b7fdf16e 100644
--- a/src/FDM/YASim/YASim.cxx
+++ b/src/FDM/YASim/YASim.cxx
@@ -356,10 +356,18 @@ void YASim::copyFromYASim()
 
     // _set_Geocentric_Rates(M2FT*v[0], M2FT*v[1], M2FT*v[2]); // UNUSED
 
-    Math::vmul33(s->orient, s->v, v);
+    // Airflow velocity.
+    float wind[3];
+    wind[0] = get_V_north_airmass() * FT2M * -1.0;  // Wind in NED
+    wind[1] = get_V_east_airmass() * FT2M * -1.0;
+    wind[2] = get_V_down_airmass() * FT2M * -1.0;
+    Math::tmul33(xyz2ned, wind, wind);              // Wind in global
+    Math::sub3(s->v, wind, v);                      // V - wind in global
+    Math::vmul33(s->orient, s->v, v);               // to body coordinates
     _set_Velocities_Wind_Body(v[0]*M2FT, -v[1]*M2FT, -v[2]*M2FT);
     _set_V_rel_wind(Math::mag3(v)*M2FT); // units?
 
+
     // These don't work, use a dummy based on altitude
     // float P = get_Static_pressure();
     // float T = get_Static_temperature();