]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPosition.cpp
Initial revision.
[flightgear.git] / src / FDM / JSBSim / FGPosition.cpp
index 33f244dfbc5bfe8431ee4c2ff48dad6878dd0387..741d9cd4a6e34b4f8f042706fe9d31505898aa37 100644 (file)
@@ -102,6 +102,8 @@ FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex)
   lastLongitudeDot = lastLatitudeDot = lastRadiusDot = 0.0;
   Longitude = Latitude = 0.0;
   gamma = Vt = Vground = 0.0;
+  hoverbmac = hoverbcg = 0.0;
+  psigt = 0.0;
 
   Debug(0);
 }
@@ -148,17 +150,15 @@ bool FGPosition::Run(void) {
 
     Vground = sqrt( vVel(eNorth)*vVel(eNorth) + vVel(eEast)*vVel(eEast) );
     psigt =  atan2(vVel(eEast), vVel(eNorth));
-    if(psigt < 0.0)
+    if (psigt < 0.0)
       psigt += 2*M_PI;
 
-    invMass   = 1.0 / MassBalance->GetMass();
     Radius    = h + SeaLevelRadius;
-    invRadius = 1.0 / Radius;
 
     cosLat = cos(Latitude);
     if (cosLat != 0) LongitudeDot = vVel(eEast) / (Radius * cosLat);
 
-    LatitudeDot = vVel(eNorth) * invRadius;
+    LatitudeDot = vVel(eNorth) Radius;
     RadiusDot   = -vVel(eDown);
 
     Longitude += 0.5*dt*rate*(LongitudeDot + lastLongitudeDot);