resolve_powder_adjusted_velocity

Function resolve_powder_adjusted_velocity 

Source
pub fn resolve_powder_adjusted_velocity(
    nominal_velocity_mps: f64,
    ambient_temperature_c: f64,
    use_powder_sensitivity: bool,
    powder_temp_sensitivity_mps_per_c: f64,
    powder_reference_temp_c: f64,
    powder_temp_curve: Option<&[(f64, f64)]>,
    powder_curve_temp_c: Option<f64>,
) -> f64
Expand description

Resolve the powder-temperature-adjusted muzzle velocity (m/s) — the velocity the solver actually flies. A non-empty measured powder_temp_curve takes precedence (interpolated at powder_curve_temp_c, falling back to the ambient ambient_temperature_c; clamped at the endpoints) and REPLACES the nominal velocity; otherwise, when use_powder_sensitivity is set, the linear model adds sensitivity x (ambient - reference) to it. All inputs canonical SI (Celsius, m/s). This is the single shared implementation behind the trajectory solve, the powder CLI/WASM command (MBA-737), and anything else that must agree with them.