]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/LaRCsimIC.cxx
Synced with latest JSBSim as of June 5, 2001.
[flightgear.git] / src / FDM / LaRCsimIC.cxx
index 9b00c3b584075dd26e3af9055cf60fa2c03490c2..5ec1db499a3021e9e5e7261e87d5a5e307d97797 100644 (file)
 */ 
  
 
+#include <simgear/compiler.h>
+
+#include <math.h>
+#include STL_IOSTREAM
+
 #include "FDM/LaRCsimIC.hxx"
 #include <FDM/LaRCsim/ls_cockpit.h>
 #include <FDM/LaRCsim/ls_generic.h>
 #include <FDM/LaRCsim/atmos_62.h>
 #include <FDM/LaRCsim/ls_constants.h>
 #include <FDM/LaRCsim/ls_geodesy.h>
-#include <math.h>
-#include <iostream>
+
+#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
+SG_USING_STD(cout);
+SG_USING_STD(endl);
+#endif
+
 
 LaRCsimIC::LaRCsimIC(void) {
   vt=vtg=vw=vc=ve=0;
@@ -97,7 +106,7 @@ void LaRCsimIC::SetClimbRateFpsIC( SCALAR tt) {
     getTheta();
     vdown=-1*hdot;
     cout << "hdot: " << hdot << endl;
-    cout << "gamma: " << gamma*RAD_TO_DEG << endl;
+    cout << "gamma: " << gamma*SGD_RADIANS_TO_DEGREES << endl;
     cout << "vdown: " << vdown << endl;
   }
 }
@@ -119,40 +128,18 @@ void LaRCsimIC::SetPitchAngleRadIC(SCALAR tt) {
   getAlpha();
 }
 
-void LaRCsimIC::SetUBodyFpsIC( SCALAR tt) {
-  u=tt;
+void LaRCsimIC::SetUVWFpsIC(SCALAR vu, SCALAR vv, SCALAR vw) {
+  u=vu; v=vv; w=vw;
   vt=sqrt(u*u+v*v+w*w);
   lastSpeedSet=lssetuvw;
 }
 
   
-void LaRCsimIC::SetVBodyFpsIC( SCALAR tt) {
-  v=tt;
-  vt=sqrt(u*u+v*v+w*w);
-  lastSpeedSet=lssetuvw;
-}
-
-void LaRCsimIC::SetWBodyFpsIC( SCALAR tt) {
-  w=tt;
-  vt=sqrt(u*u+v*v+w*w);
-  lastSpeedSet=lssetuvw;
-}
-
-void LaRCsimIC::SetVNorthAirmassFpsIC(SCALAR tt) {
-  vnorthwind=tt;
-  vw=sqrt(vnorthwind*vnorthwind + veastwind*veastwind + vdownwind*vdownwind);
-}  
-
-void LaRCsimIC::SetVEastAirmassFpsIC(SCALAR tt) {
-  veastwind=tt;
-  vw=sqrt(vnorthwind*vnorthwind + veastwind*veastwind + vdownwind*vdownwind);
-}  
-
-void LaRCsimIC::SetVDownAirmassFpsIC(SCALAR tt){
-  vdownwind=tt;
+void LaRCsimIC::SetVNEDAirmassFpsIC(SCALAR north, SCALAR east, SCALAR down ) {
+  vnorthwind=north; veastwind=east; vdownwind=down;
   vw=sqrt(vnorthwind*vnorthwind + veastwind*veastwind + vdownwind*vdownwind);
   vtg=vt+vw;
-  hdot=-vtg*sin(gamma);
+  SetClimbRateFpsIC(-1*(vdown+vdownwind));
 }  
 
 void LaRCsimIC::SetAltitudeFtIC( SCALAR tt) {
@@ -243,25 +230,15 @@ void LaRCsimIC::calcNEDfromVt(void) {
            vdownwind;
 }           
 
-void LaRCsimIC::SetVnorthFpsIC( SCALAR tt) {
-  vnorth=tt;
+void LaRCsimIC::SetVNEDFpsIC( SCALAR north, SCALAR east, SCALAR down) {
+  vnorth=north;
+  veast=east;
+  vdown=down;
+  SetClimbRateFpsIC(-1*vdown);
   lastSpeedSet=lssetned;
   calcVtfromNED();
 }        
   
-void LaRCsimIC::SetVeastFpsIC( SCALAR tt) {
-  veast=tt;
-  lastSpeedSet=lssetned;
-  calcVtfromNED();
-} 
-
-void LaRCsimIC::SetVdownFpsIC( SCALAR tt) {
-  vdown=tt;
-  calcVtfromNED();
-  SetClimbRateFpsIC(-1*vdown);
-  lastSpeedSet=lssetned;
-} 
-
 void LaRCsimIC::SetLatitudeGDRadIC(SCALAR tt) {
   latitude_gd=tt;
   ls_geod_to_geoc(latitude_gd,altitude,&sea_level_radius, &latitude_gc);