Index: /trunk/BNC/src/bncantex.cpp
===================================================================
--- /trunk/BNC/src/bncantex.cpp	(revision 11103)
+++ /trunk/BNC/src/bncantex.cpp	(revision 11104)
@@ -786,5 +786,5 @@
                                  const ColumnVector& vSat, ColumnVector& dx,
                                  e_attMode mode, double externalYaw,
-                                 const QString& stateKey) {
+                                 const QString& stateKey, double* yawUsed) {
 
   // separate yaw model states per caller (stateKey), each called in time order
@@ -890,4 +890,23 @@
         sy /= sqrt(DotProduct(sy,sy));
         sx = crossproduct(sy, sz);
+      }
+
+      // yaw angle used: rotation of the body x-axis around sz relative to
+      // the velocity-referenced frame (convention of psiEff/externalYaw)
+      if (yawUsed) {
+        if (useVelocityFrame) {
+          *yawUsed = psiEff;
+        }
+        else if (vSat.size() == 3) {
+          ColumnVector Omega(3); Omega(1) = 0.0; Omega(2) = 0.0; Omega(3) = t_CST::omega;
+          ColumnVector vInert = vSat + crossproduct(Omega, xSat);
+          ColumnVector sy0 = crossproduct(sz, vInert);
+          sy0 /= sqrt(DotProduct(sy0,sy0));
+          ColumnVector sx0 = crossproduct(sy0, sz);
+          *yawUsed = atan2(DotProduct(crossproduct(sx0, sx), sz), DotProduct(sx0, sx));
+        }
+        else {
+          *yawUsed = 0.0;
+        }
       }
 
Index: /trunk/BNC/src/bncantex.h
===================================================================
--- /trunk/BNC/src/bncantex.h	(revision 11103)
+++ /trunk/BNC/src/bncantex.h	(revision 11104)
@@ -67,5 +67,6 @@
                            e_attMode mode = ATT_COMPUTED,
                            double externalYaw = 0.0,
-                           const QString& stateKey = QString());
+                           const QString& stateKey = QString(),
+                           double* yawUsed = 0);
 
   // Drain and return diagnostic logs accumulated by the yaw models.
