ballistics_density_altitude_temperature_c

Function ballistics_density_altitude_temperature_c 

Source
#[unsafe(no_mangle)]
pub extern "C" fn ballistics_density_altitude_temperature_c( density_altitude_m: c_double, explicit_temperature_c: c_double, ) -> c_double
Expand description

Back-solve the station TEMPERATURE (Celsius) an ISA-equivalent atmosphere at density_altitude_m implies (MBA-1366; see crate::atmosphere::resolve_atmosphere_for_density_altitude for the full derivation).

FFIAtmosphericConditions is an ABI-frozen repr(C) struct (the same iOS-consumer contract enforced by a regression test as ballistics_reduce_qnh_pressure/ ballistics_bc_for_reference_standard) with no room for a density-altitude field, so this is a standalone pure conversion — call it (and its two companions below) once on a declared density altitude, then write the three results into FFIAtmosphericConditions.temperature/ .pressure/.altitude before calling any existing ballistics_calculate_trajectory*/ ballistics_calculate_zero_angle*/ballistics_monte_carlo* export unchanged — a pure addition to the C ABI requiring no recompile for existing callers.

explicit_temperature_c: pass FFI_NO_EXPLICIT_TEMPERATURE (NaN) for the ISA-at-density- altitude default, or a real Celsius value to have it honored exactly (density is still honored either way — only the implied pressure/altitude differ; see the Rust doc comment). A non-finite density_altitude_m returns NaN for all three exports (there is no plausible station value to fall back to, unlike the QNH/BC conversions above, which return their input unchanged).