Skip to main content

estimate_bc_fit

Function estimate_bc_fit 

Source
pub fn estimate_bc_fit(
    velocity: f64,
    mass: f64,
    diameter: f64,
    points: &[(f64, f64)],
    drag_model: DragModel,
    mode: BcFitMode,
) -> Result<BcEstimate, BallisticsError>
Expand description

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.

points are (distance_m, value_m_or_mps) where the second element is drop in meters (BcFitMode::Drop) or remaining speed in m/s (BcFitMode::Velocity).