calculate_zero_range_from_angle_with_conditions

Function calculate_zero_range_from_angle_with_conditions 

Source
pub fn calculate_zero_range_from_angle_with_conditions(
    inputs: BallisticInputs,
    zero_angle_rad: f64,
    target_height: f64,
    wind: WindConditions,
    atmosphere: AtmosphericConditions,
) -> Result<ZeroCrossings, BallisticsError>
Expand description

Solve the zero RANGE(S) that a fixed bore angle produces. Runs the trajectory at zero_angle_rad and returns BOTH line-of-sight crossings it finds, as ZeroCrossings — a rifle sighted above the bore generally crosses a level line of sight twice on a rising shot (near, ascending, close to the muzzle; far, descending past the apex).

This is NOT the exact inverse of calculate_zero_angle_with_conditions. A single bore angle generally implies two valid zero distances (the classic 25/300-yard battle-zero relationship is exactly this: one angle, two zeros), and calculate_zero_angle_with_conditions’s own choice of root depends on which target distance it was asked to solve for. Round-tripping a solved angle back through this function recovers the ORIGINAL distance as one of the two returned crossings, not necessarily as far_m specifically — for short/flat zeros the forward solver’s answer is often the NEAR crossing.