36float relAltitude(
float pressure,
float pressureRef,
float temperatureRef)
38 return temperatureRef / a * (1 - powf(pressure / pressureRef, nInv));
41float relPressure(
float altitude,
float pressureRef,
float temperatureRef)
43 return pressureRef * powf(1 - a * altitude / temperatureRef, n);
48 return temperatureRef - Constants::a * altitude;
51float relDensity(
float pressure,
float pressureRef,
float altitudeRef,
54 return pressure / (R * a * altitudeRef +
55 R * temperatureRef * powf(pressure / pressureRef, nInv));
58float mslPressure(
float pressureRef,
float temperatureRef,
float altitudeRef)
61 return pressureRef / powf(1 - a * altitudeRef / T0, n);
66 return temperatureRef + Constants::a * altitudeRef;
71 return -(tRef * dpDt * powf(p / pRef, nInv)) / (a * n * p);
74Vector2f
geodetic2NED(
const Vector2f& target,
const Vector2f& origin)
76 float mPerDegLat = 111132.95225;
78 fabsf(111412.87733 * cosf(target[0] * Constants::DEGREES_TO_RADIANS));
81 mPerDegLat * (target[0] - origin[0]),
82 mPerDegLon * (target[1] - origin[1]),
88 float T = t0 + Constants::a * d;
89 return Constants::RHO_0 *
90 powf(T / Constants::MSL_TEMPERATURE,
91 Constants::g / (Constants::a * Constants::R) - 1.f);
96 float T = t0 + Constants::a * d;
97 float c = sqrtf(Constants::GAMMA_AIR * Constants::R * T);
108 return sqrtf(((powf(pressureTotal / pressureStatic,
109 (Constants::GAMMA_AIR - 1) / Constants::GAMMA_AIR)) -
111 (2 / (Constants::GAMMA_AIR - 1)));
124 return coeff.n000 + coeff.n100 * mach + coeff.n200 * powf(mach, 2) +
125 coeff.n300 * powf(mach, 3) + coeff.n400 * powf(mach, 4) +
126 coeff.n500 * powf(mach, 5) + coeff.n600 * powf(mach, 6);
float computePitotMach(float pressureTotal, float pressureStatic)
Computes the mach from total and static pressure measures from a pitot tube.
float computePitotAirspeed(float pressureTotal, float pressureStatic, float d, float t0)
Computes air speed relative to the pitot tube.
float computeMach(float d, float vtot, float t0)
Computes the mach relative to the speed at a certain altitude.
float verticalSpeed(float p, float dpDt, float pRef, float tRef)
float mslPressure(float pressureRef, float temperatureRef, float altitudeRef)
Returns the expected pressure at mean sea level based on temperature and pressure at a reference alti...
float relDensity(float pressure, float pressureRef, float altitudeRef, float temperatureRef)
Returns the air density given the pressure with respect to a reference pressure, altitude and tempera...
Vector2f geodetic2NED(const Vector2f &target, const Vector2f &origin)
float computeCd(const AerodynamicCoeff &coeff, float mach)
Computes the CD from aerodynamic coefficients and mach.
float mslTemperature(float temperatureRef, float altitudeRef)
Returns the expected temperature at mean sea level based on temperature at a reference altitude,...
float relAltitude(float pressure, float pressureRef, float temperatureRef)
Returns the altitude given the pressure with respect to a reference pressure and temperature,...
float relPressure(float altitude, float pressureRef, float temperatureRef)
Returns the pressure given the altitude with respect to a reference pressure and temperature,...
float computeSoundSpeed(float d, float t0)
Computes the speed of sound at the given altitude.
float relTemperature(float altitude, float temperatureRef)
Returns the temperature at the given altitude with respect to the reference temperature.
float computeRho(float d, float t0)
Computes the rho (air density) of air at the given altitude.
This file includes all the types the logdecoder script will decode.