|
lob 0.11.0
Exterior ballistics library — API + technical reference
|
The forward solve returns the trajectory's height and windage at the requested down-range distances.
pranges are feet, strictly increasing, > 0 except an entry may be 0 for the muzzle. pouts[i].range echoes the achieved range in feet (truncated from the integrated position). Returns the number of outputs written; on invalid arguments returns 0 (source/lob_solve.cpp).
LobOutput (include/lob/lob.h):
range — feet reached for this entryvelocity — fps at that range, uint16_tenergy — foot-pounds, uint32_televation — inches of vertical displacement relative to the sight line (P.Y - optic_height). Negative is below the line of sight.deflection — inches of lateral displacement (wind + spin drift).time_of_flight — secondsFor a forward solve, elevation/deflection are linear distances. For inverse solves they are angles in MOA (Inverse Solve).
Integration proceeds in down-range steps (ODE Integration) until one of:
max_time exceeded — the last output is linearly interpolated to max_time;minimum_speed or minimum_energy (converted to a speed via CalculateVelocityFromKineticEnergy; the effective minimum_speed is max(explicit, from_energy), source/lob_builder.cpp) reached — linearly interpolated to that speed;|v_y| > 3 v_x — treated as falling straight down, source/lob_solve.cpp). Output records the achieved state at that step.If the projectile cannot reach a requested range, LobSolve still produces an output at the fall-short distance (max_time and minimum_speed are linearly interpolated, while tumble records the step state); LobSolveInverse calls that same LobSolve and then stops at the first R where SolveAngle returns NaN, returning only the reachable prefix (Inverse Solve).
LobSolve returns 0 without touching pouts if:
size == 0, ctx.error != kLobErrorNone, ctx.velocity == 0, ctx.speed_of_sound <= 0, or ctx.zero_angle is NaN;pranges is not strictly increasing.No allocation or exceptions occur inside the solve.