Module ffi

Module ffi 

Source
Expand description

FFI bindings for iOS/Swift integration

Structs§

FFIAtmosphericConditions
FFIBallisticInputs
FFIMonteCarloParams
FFIMonteCarloResults
FFITrajectoryPoint
FFITrajectoryResult
FFITrajectorySample
FFIWindConditions

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_trajectory with 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_value are ignored, and the retardation denominator becomes the projectile’s sectional density (mass and diameter in inputs must therefore be positive). Mach values must be strictly ascending with drag_table_len in [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_table with an additional whole-curve drag scale (MBA-1356): the deck’s interpolated Cd is multiplied by cd_scale at the same site the base export uses, i.e. Cd_used = table.interpolate(mach) * cd_scale. cd_scale = 1.0 is neutral and produces byte-identical output to ballistics_calculate_trajectory_with_drag_table on 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_angle with 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_value are ignored, and the retardation denominator becomes the projectile’s sectional density (mass and diameter in inputs must therefore be positive). Mach values must be strictly ascending with drag_table_len in [2, MAX_FFI_DRAG_TABLE_LEN] and finite positive Cd; outside the deck’s Mach domain the nearest endpoint Cd is held. Pair this with ballistics_calculate_trajectory_with_drag_table using 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_table with an additional whole-curve drag scale (MBA-1356): the deck’s interpolated Cd is multiplied by cd_scale at the same site the base export uses, i.e. Cd_used = table.interpolate(mach) * cd_scale. cd_scale = 1.0 is neutral and produces byte-identical output to ballistics_calculate_zero_angle_with_drag_table on the same deck. Pair this with ballistics_calculate_trajectory_with_drag_table_scaled using the same deck AND the same cd_scale to 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