public void CalculateConstants(CelestialBody body, float speed, double altitude) { double atmosphereTemperatureOffset = 0; atmoTemp = body.GetFullTemperature(altitude, atmosphereTemperatureOffset); density = body.GetDensity(staticPressurekPa, atmoTemp); mach = CalculateMachNumber(body, speed, staticPressurekPa, density); staticPressurekPa = body.GetPressure(altitude); convectiveMachScale = Math.Pow(UtilMath.Clamp01( (mach - PhysicsGlobals.NewtonianMachTempLerpStartMach) / (PhysicsGlobals.NewtonianMachTempLerpEndMach - PhysicsGlobals.NewtonianMachTempLerpStartMach)), PhysicsGlobals.NewtonianMachTempLerpExponent); }