]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGColumnVector3.cpp
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGColumnVector3.cpp
index 96a69e64b2dcb9e032f3a3e82df633eb15c27ae9..a52cc6e1052a6918eab1b8ca3b116f6e2a59fddd 100644 (file)
@@ -19,6 +19,7 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGColumnVector3.h"
+#include <cstdio>
 
 namespace JSBSim {
 
@@ -37,6 +38,15 @@ FGColumnVector3::FGColumnVector3(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+string FGColumnVector3::Dump(string delimeter) const
+{
+  char buffer[256];
+  sprintf(buffer, "%f%s%f%s%f", Entry(1), delimeter.c_str(), Entry(2), delimeter.c_str(), Entry(3));
+  return string(buffer);
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 FGColumnVector3 FGColumnVector3::operator/(const double scalar) const
 {
   if (scalar != 0.0)
@@ -44,7 +54,7 @@ FGColumnVector3 FGColumnVector3::operator/(const double scalar) const
 
   cerr << "Attempt to divide by zero in method "
     "FGColumnVector3::operator/(const double scalar), "
-    "object " << this << endl; 
+    "object " << this << endl;
   return FGColumnVector3();
 }
 
@@ -66,7 +76,7 @@ FGColumnVector3& FGColumnVector3::operator/=(const double scalar)
 
 double FGColumnVector3::Magnitude(void) const
 {
-  if (data[1] == 0.0 && data[2] == 0.0 && data[3] == 0.0)
+  if (Entry(1) == 0.0 && Entry(2) == 0.0 && Entry(3) == 0.0)
     return 0.0;
   else
     return sqrt( Entry(1)*Entry(1) +  Entry(2)*Entry(2) +  Entry(3)*Entry(3) );
@@ -97,7 +107,7 @@ ostream& operator<<(ostream& os, const FGColumnVector3& col)
 {
   os << col(1) << " , " << col(2) << " , " << col(3);
   return os;
-}  
+}
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 //    The bitmasked value choices are as follows: