|
lob 0.11.0
Exterior ballistics library — API + technical reference
|
The inverse solve answers the shooter's question: what sight adjustment is needed to hit at this range?
All three overloads (raw pointer, std::array, single value) share semantics with the forward solve.
Forward: at range R, with launch angle θ₀ = zero_angle + aerodynamic_jump, the trajectory height is y(R; θ₀) (inches).
Inverse: find θ* such that y(R; θ*) = 0 and report the adjustment Δ = θ* − zero_angle (MOA) plus a windage adjustment −deflection_inches → MOA at the same R.
In the returned Output, elevation and deflection are MOA, not inches. range, velocity, energy, time_of_flight are unchanged from the forward trajectory at that R.
LobSolveInverse — iterative, accurate.
R, computes f(θ)=y(R;θ) via the same integrator as Zero-Angle Solver.FastInverseAngle applied to the forward residual, then iterates LobSolveInverse with the shared angle solver (Zero-Angle Solver, Shared Angle Solver).R is unreachable (SolveAngle returns NaN) solving stops at that index and the unreachable entry is not counted — the caller gets only the reachable prefix. A range==0 entry is counted with 0 MOA.Typical convergence: ≤ 10 iterations, 0.01 MOA tolerance, clamped to ±45°.
LobFastInverse — one-step approximation.
Converts already-computed forward outputs in place. For each out:
Entries with range==0 or non-finite elevation/deflection are skipped and not counted. Only convert outputs whose forward solution actually reached R; fall-short trajectories yield a meaningless residual and a meaningless one-step angle (the doc comment in include/lob/lob.h says so explicitly). Unlike LobSolveInverse, a short fall does not stop the batch — it is silently given a (wrong) number, hence the warning.
SolveInverse when you need trustworthy MOA numbers.FastInverse when you already have forward outputs, the ranges are known-reachable, and you prefer to avoid re-integrating. Verify by comparing against SolveInverse on a spot check — the two agree within ~0.1 MOA in the tests (test/source/lob_inverse_test.cpp).0.pranges → 0 (same guard as forward).range → LobSolveInverse counts it with 0 MOA; LobFastInverse skips it and does not count it (source/lob_solve.cpp).LobSolveInverse requires strictly increasing pranges (same guard as LobSolve); LobFastInverse is an in-place conversion of the supplied pouts and does not receive pranges.