]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/Atmosphere.cpp
Use the density values from the environment subsystem, to properly handle
[flightgear.git] / src / FDM / YASim / Atmosphere.cpp
index 18b54dd2431a0df84398175ffea428e29fcbc453..83c6b974897862d3e0fe7ea485a7e028b14d4624 100644 (file)
@@ -53,10 +53,11 @@ float Atmosphere::getStdDensity(float alt)
     return getRecord(alt, 3);
 }
 
-float Atmosphere::calcVEAS(float spd, float pressure, float temp)
+float Atmosphere::calcVEAS(float spd,
+                           float pressure, float temp, float density)
 {
     static float rho0 = getStdDensity(0);
-    float densityRatio = calcDensity(pressure, temp) / rho0;
+    float densityRatio = density / rho0;
     return spd * Math::sqrt(densityRatio);
 }
 
@@ -91,7 +92,7 @@ float Atmosphere::calcVCAS(float spd, float pressure, float temp)
     return Math::sqrt((7*p0/rho0)*(tmp-1));
 }
 
-float Atmosphere::calcDensity(float pressure, float temp)
+float Atmosphere::calcStdDensity(float pressure, float temp)
 {
     return pressure / (R * temp);
 }