1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
//! # Ballistics Engine
//!
//! High-performance ballistics trajectory calculation engine with comprehensive physics modeling.
//!
//! ## Interactive Web Demo
//!
//! Try the ballistics engine directly in your browser at [https://ballistics.rs/](https://ballistics.rs/)
//!
//! ## Features
//!
//! - Professional-grade trajectory calculations with multiple drag models
//! - Advanced physics including spin drift, Coriolis effect, and Magnus force
//! - Monte Carlo simulations for uncertainty analysis
//! - WebAssembly support for browser-based applications
//! - FFI bindings for iOS and Android development
// Re-export the main types and functions
pub use ;
pub use ;
pub use DragModel;
pub use ;
pub use ;
pub use ;
pub use solve_v1;
pub use ;
pub use MAX_TRAJECTORY_SAMPLES;
// Module declarations
// The C ABI. Gated behind the default-on `ffi` feature so a binary that links two versions of
// this crate can disable it on one edge and avoid duplicate #[no_mangle] symbols.
// 0.33.0 decision-support Task 2: reverse conversion from a resolved request back into a
// solvable one (`impl From<&ResolvedSolveRequestV1> for SolveRequestV1`), the direction the
// perturbation kernel needs to take a resolved request, change one input, and re-solve. No
// public items of its own -- the trait impl is usable wherever solve_json's public types are.
// MBA-1343: multi-observation velocity/BC truing core, shared by the CLI and the WASM terminal.
// MBA-1346: observation-range experiment design for identifiable MV/BC truing.
// MBA-1353: opt-in uncertainty-aware joint MV/BC truing.
// MBA-1357: Mach-keyed DSF (drop-scale-factor) truing table — a drop-only post-processing
// correction applied to a solved TrajectoryResult. No feature gate: must compile for wasm32;
// fs-free (profile persistence lives in main.rs).
// MBA-1392: back-solve the effective crosswind from an observed horizontal miss (wind-call
// truing). Carries its own shared table/JSON/CSV formatter so the native CLI and the WASM
// terminal render identical bytes. No feature gate: must compile for wasm32.
// MBA-1349: robust hold corridors across named segmented-wind scenarios. No feature gate:
// must compile for wasm32 (the CLI surface is native-only this train, but the core and its
// shared formatter are ready for the WASM follow-up); fs-free — file reading stays in
// main.rs, this module parses TEXT.
// MBA-1361: reticle schema, parametric generators, and the hold-point-in-reticle API,
// shared by the CLI, the WASM terminal and the FFI. No feature gate: must compile for
// wasm32; pure math + serde, no I/O (file reading stays in main.rs/wasm.rs).
// MBA-1440: import Bero's "Ventum" reticle spec into `reticle::ReticleDescription` so a
// reticle drawn in that tool can be hold-solved by `reticle::hold_point_in_reticle`. Pure
// transform + serde, no I/O; must compile for wasm32. Deliberately NOT wired into the
// CLI / solve-json / WASM / FFI surfaces yet (that exposure is held for review).
// MBA-1343 Phase B: WEZ (`monte-carlo --wez`) sweep core, shared by the CLI and the WASM terminal.
// MBA-1355: turret adjustment-unit conversions (SMOA/IPHY/clicks) and click-value parsing,
// shared by the CLI and the WASM terminal. No feature gate: must compile for wasm32.
// MBA-1409: cleanroom `.drg` (Doppler drag-curve text file) parser, shared by the CLI and
// the WASM terminal. No feature gate: must compile for wasm32; parses TEXT only (no
// std::fs — file I/O stays in main.rs/wasm.rs).
// MBA-1372: SAAMI free-recoil momentum-balance calculator, shared by the CLI and the
// WASM terminal. No feature gate: must compile for wasm32; pure math, no I/O.
// MBA-1372: power-factor arithmetic and per-organization (USPSA/IDPA/SASS) rulebook
// pass/fail thresholds, shared by the CLI and the WASM terminal. No feature gate: must
// compile for wasm32; pure math + a data table, no I/O.
// MBA-154: Make constants public for ballistics_rust wrapping
// MBA-153: Make wind_shear public for ballistics_rust wrapping
// MBA-154: Make derivatives public for ballistics_rust wrapping
// MBA-154: Make fast_trajectory public for ballistics_rust wrapping
// MBA-155: Add advanced integration methods (RK4, RK45)
// MBA-149 Phase 5 Priority 2: Export enhanced spin_drift
// MBA-149 Phase 5 Priority 2: Export enhanced precession_nutation
// MBA-153: Make aerodynamic_jump public for ballistics_rust wrapping
// MBA-149 Phase 5 Priority 2: Export enhanced angle_calculations
// MBA-153: Make reynolds public for ballistics_rust wrapping
// MBA-149 Phase 5 Priority 2: Export enhanced form_factor
// MBA-153: Make monte_carlo public for ballistics_rust wrapping
// MBA-1352 Task 2: Monte Carlo hit-statistics foundation -- Welford streaming moments and
// fixed-n Wilson score intervals. The anytime-valid confidence sequence (Task 3) extends this
// module. No feature gate: must compile for wasm32; pure std math, no randomness.
// 0.33.0 decision-support Phase 1: shared input taxonomy for perturbation kernel and
// uncertainty propagation. No feature gate: must compile for wasm32 (pure data + serde).
// MBA-1345: explain why two fully resolved solve results differ, by symmetric counterfactual
// swap of each input group (built on `perturbation`'s Tasks 5-8 kernel). No feature gate: must
// compile for wasm32 (depends only on perturbation/solve_json/solve_v1, all unconditional).
// MBA-1347: erf/erfc/normal_cdf for hit-probability integration (mass of a bivariate
// normal over a target). In-crate rather than a dependency: the crate ships to thirteen
// platforms including big-endian MIPS and wasm32 and already hand-rolls its statistical
// constants. No feature gate: must compile for wasm32; pure std float math, no I/O.
// 0.33.0 decision-support Task 10, MBA-1347: propagate declared per-input uncertainty to
// impact covariance via the perturbation kernel's central differences, and rank sources by
// variance share into a measurement-priority report. Built on `perturbation` (Tasks 5-8) and
// reuses `truing_uncertainty::Symmetric2` for the 2x2 covariance/eigenvalue arithmetic. No
// feature gate: must compile for wasm32 (depends only on perturbation/solve_json/
// truing_uncertainty, all unconditional).
// 0.33.0 decision-support Task 12, MBA-1350: one-variable tolerance envelopes -- how far a
// single input may drift from its own current value before the impact leaves an explicit
// target, by monotone bisection outward from the nominal (`perturbation::bisect_axis`, Task 7).
// Reuses `error_budget::TargetGeometryV1` and its unavailable-axis classification verbatim. No
// feature gate: must compile for wasm32 (depends only on perturbation/error_budget/solve_json,
// all unconditional).
// 0.33.0 decision-support Task 3, MBA-1348: turret + reticle geometry model (click
// detents/revolutions, zero stop, travel limits, current turret state, reticle hold
// bounds) that a later dial/hold/hybrid engagement planner will read. Pure data +
// validation; no feature gate: must compile for wasm32 (depends only on `adjustment`,
// itself unconditional).
// 0.33.0 decision-support Task 8: `HoldCurve`, the drop-vs-range interpolation core shared
// by `mark-to-range`, `bdc-match`, `optimal-zero` and `reticle hold --range`, promoted out of
// the CLI binary (together with the sampled-trajectory helpers it solves through) so the
// range-card work its own doc comment already nominates can reuse it as a library dependency.
// No feature gate: must compile for wasm32 (pure math over already-resolved inputs; no fs, no
// clap -- CLI argument resolution stays in `main.rs`).
// 0.33.0 decision-support Task 9: `CardRow`, the shared display-ready row type behind the
// come-ups/range-table/wind-card/compare CLI surfaces, replacing four function-local row
// structs that each said the same thing a different way. Pure data; no feature gate: must
// compile for wasm32 (no fs, no clap, no pdf -- those stay in main.rs). Task 10 rewrites the
// PDF dope card on `&[CardRow]`; Task 11 grows an adaptive-card engine here.
// 0.33.0 decision-support Task 10: the PDF dope card, promoted out of the `ballistics`
// binary (it was `mod pdf_dope_card;`, private to `main.rs`) so it can consume
// `card::CardRow` directly instead of its own `DopeCardRow { range_yd: u32, .. }` -- that
// u32-yards field couldn't express the non-integer ranges Task 11's adaptive card engine
// produces. Feature-gated (unlike `card`): pulls in `printpdf` (PDF generation) and `dirs`
// (font-file lookup), neither wasm32-safe nor free -- `pdf` is on by default but the
// wasm32 build always passes `--no-default-features`.
// Online mode: HTTP client for Flask API (feature-gated)
// BC5D table auto-download (feature-gated)
// BC correction table for offline mode
// 5D BC correction tables (caliber-specific, ML-derived)
// Import of third-party ballistic profile files (.a7p), feature-gated
// Internal type alias for compatibility
pub type InternalBallisticInputs = BallisticInputs;
// BC segment data for velocity-dependent BC