#[unsafe(no_mangle)]pub extern "C" fn ballistics_bc_for_reference_standard(
bc: c_double,
reference_standard: c_int,
) -> c_doubleExpand description
Convert a ballistic coefficient declared under reference_standard to the ICAO-referenced
value every FFIBallisticInputs.bc_value in this module expects (MBA-1365).
FFIBallisticInputs is an ABI-frozen repr(C) struct (an iOS-consumer contract enforced
by a regression test) with no room to add a reference-standard field, so this is a
standalone pure conversion instead of a struct setter: call it once on a raw BC before
writing the result into FFIBallisticInputs.bc_value, then use every existing
ballistics_calculate_trajectory*/ballistics_calculate_zero_angle*/ballistics_monte_carlo*
export completely unchanged. reference_standard == FFI_BC_REFERENCE_ICAO (0) is a
no-op, so every existing caller that never calls this function is unaffected — this is a
pure addition to the ABI, not a modification, so no recompile is required unless a caller
opts into the new symbol.
reference_standard == FFI_BC_REFERENCE_ARMY_STANDARD_METRO (1) multiplies by
crate::constants::ASM_TO_ICAO_BC, the same constant and the same single multiply
crate::cli_api::TrajectorySolver::new applies for the CLI/WASM/Rust-native surfaces.
A non-finite bc is returned unchanged (this function performs no validation; the
existing bc_value must be finite and greater than zero solve-time check still applies).