Expand description
FFI bindings for iOS/Swift integration
Structs§
- FFIAtmospheric
Conditions - FFIBallistic
Inputs - FFIMonte
Carlo Params - FFIMonte
Carlo Results - FFITrajectory
Point - FFITrajectory
Result - FFITrajectory
Sample - FFIWind
Conditions
Constants§
- MAX_
FFI_ DRAG_ TABLE_ LEN - Maximum C-ABI custom drag-table row count.
- MIN_
FFI_ STEP_ SIZE_ MS - Minimum C-ABI trajectory
step_size, in milliseconds (0.1 ms = 0.0001 s).
Functions§
- ballistics_
calculate_ ⚠trajectory - Calculate a trajectory through the C ABI.
- ballistics_
calculate_ ⚠trajectory_ with_ drag_ table ballistics_calculate_trajectorywith a caller-supplied custom drag deck (Cd vs Mach, e.g. Hornady CDM / Doppler-radar data). The deck REPLACES the G-model + BC for drag:bc_type/bc_valueare ignored, and the retardation denominator becomes the projectile’s sectional density (mass and diameter ininputsmust therefore be positive). Mach values must be strictly ascending withdrag_table_lenin[2, MAX_FFI_DRAG_TABLE_LEN]and finite positive Cd; outside the deck’s Mach domain the nearest endpoint Cd is held.- ballistics_
calculate_ ⚠trajectory_ with_ drag_ table_ scaled ballistics_calculate_trajectory_with_drag_tablewith an additional whole-curve drag scale (MBA-1356): the deck’s interpolated Cd is multiplied bycd_scaleat the same site the base export uses, i.e.Cd_used = table.interpolate(mach) * cd_scale.cd_scale = 1.0is neutral and produces byte-identical output toballistics_calculate_trajectory_with_drag_tableon the same deck. Typical truing values are in[0.90, 1.10]; values outside that band are accepted here (the engine only rejects non-finite or non-positive) — an “unusually large” warning is a CLI-only concern (Task 2), not part of this frozen C ABI.- ballistics_
calculate_ ⚠zero_ angle - Calculate the zero angle for a target distance through the C ABI.
- ballistics_
calculate_ ⚠zero_ angle_ with_ drag_ table ballistics_calculate_zero_anglewith a caller-supplied custom drag deck (Cd vs Mach, e.g. Hornady CDM / Doppler-radar data). The deck REPLACES the G-model + BC for drag:bc_type/bc_valueare ignored, and the retardation denominator becomes the projectile’s sectional density (mass and diameter ininputsmust therefore be positive). Mach values must be strictly ascending withdrag_table_lenin[2, MAX_FFI_DRAG_TABLE_LEN]and finite positive Cd; outside the deck’s Mach domain the nearest endpoint Cd is held. Pair this withballistics_calculate_trajectory_with_drag_tableusing the same deck to fly the solved angle — the two exports share identical deck semantics.- ballistics_
calculate_ ⚠zero_ angle_ with_ drag_ table_ scaled ballistics_calculate_zero_angle_with_drag_tablewith an additional whole-curve drag scale (MBA-1356): the deck’s interpolated Cd is multiplied bycd_scaleat the same site the base export uses, i.e.Cd_used = table.interpolate(mach) * cd_scale.cd_scale = 1.0is neutral and produces byte-identical output toballistics_calculate_zero_angle_with_drag_tableon the same deck. Pair this withballistics_calculate_trajectory_with_drag_table_scaledusing the same deck AND the samecd_scaleto fly the solved angle. Typical truing values are in[0.90, 1.10]; values outside that band are accepted here (the engine only rejects non-finite or non-positive) — an “unusually large” warning is a CLI-only concern (Task 2).- ballistics_
free_ ⚠monte_ carlo_ results - Release Monte Carlo results allocated by either Monte Carlo C entry point.
- ballistics_
free_ ⚠trajectory_ result - Release a trajectory result allocated by
ballistics_calculate_trajectory. - ballistics_
get_ version - ballistics_
monte_ ⚠carlo - Run a Monte Carlo simulation through the C ABI.
- ballistics_
monte_ ⚠carlo_ with_ direction_ std_ dev - Run a Monte Carlo simulation with independent wind-direction uncertainty through the C ABI.
- ballistics_
quick_ trajectory