Default hit-zone radius (meters) around the point of aim at the target plane — a 30 cm
circle. Shared by the CLI, FFI, and WASM so “hit probability” means the same thing everywhere.
Estimate a BC by fitting a simulated trajectory to measured data, for a chosen drag
model (G1, G7, …) and fit basis (drop or velocity). Uses a coarse 0.01 sweep over
plausible BCs followed by a 0.001 local refine around the coarse best.
Interpolate a muzzle velocity (m/s) from a measured powder-temperature curve at
temp_c (Celsius). curve is (temperature_celsius, velocity_m_s) points; it is
sorted ascending by temperature before use. Values below the first point or above
the last are CLAMPED to the endpoint velocity (no extrapolation beyond measured
data), and segments are linearly interpolated. A single point yields a constant.
Parse a --sweep START:END:STEP temperature range (display units) for the
powder command — ONE parser shared by the native CLI and WASM so their
validation cannot drift. Returns the
inclusive row temperatures. Guarded: STEP must be positive, END >= START, and the
row count is capped so a typo can’t emit an unbounded table.
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.