From aa27b38666320b6826ad6afa102acdcdbb77f5d2 Mon Sep 17 00:00:00 2001 From: Colin Douglas Howell Date: Tue, 25 Mar 2014 01:50:21 -0700 Subject: [PATCH] Fix for issue 1423 (YASim miscomputes force vector on Surfaces with nonzero incidence) Surface::calcForce() now does reverse incidence rotation of force vector properly. --- src/FDM/YASim/Surface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/FDM/YASim/Surface.cpp b/src/FDM/YASim/Surface.cpp index db977f58a..106de68bc 100644 --- a/src/FDM/YASim/Surface.cpp +++ b/src/FDM/YASim/Surface.cpp @@ -225,8 +225,10 @@ void Surface::calcForce(float* v, float rho, float* out, float* torque) Math::add3(lwind, out, out); // Reverse the incidence rotation to get back to surface - // coordinates. - out[2] -= incidence * out[0]; + // coordinates. Since out[] is now the force vector and is + // roughly parallel with Z, the small-angle approximation + // must change its X component. + out[0] -= incidence * out[2]; // Convert back to external coordinates Math::tmul33(_orient, out, out); -- 2.39.5