Skip to main content

Crate ballistics_engine

Crate ballistics_engine 

Source
Expand description

§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/

§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-exports§

pub use cli_api::calculate_zero_angle;
pub use cli_api::calculate_zero_angle_with_conditions;
pub use cli_api::calculate_zero_angle_with_resolved_conditions;
pub use cli_api::calculate_zero_range_from_angle_with_conditions;
pub use cli_api::calculate_zero_range_from_angle_with_resolved_conditions;
pub use cli_api::estimate_bc_fit;
pub use cli_api::estimate_bc_from_trajectory;
pub use cli_api::interpolate_powder_temp_curve;
pub use cli_api::resolve_powder_adjusted_velocity;
pub use cli_api::run_monte_carlo;
pub use cli_api::run_monte_carlo_adaptive_seeded;
pub use cli_api::run_monte_carlo_with_direction_std_dev;
pub use cli_api::run_monte_carlo_with_wind;
pub use cli_api::run_monte_carlo_with_wind_and_direction_std_dev;
pub use cli_api::run_monte_carlo_with_wind_and_direction_std_dev_seeded;
pub use cli_api::AdaptiveMcReportV1;
pub use cli_api::AtmosphericConditions;
pub use cli_api::BallisticInputs;
pub use cli_api::BallisticsError;
pub use cli_api::BcEstimate;
pub use cli_api::BcFitMode;
pub use cli_api::BcReferenceStandard;
pub use cli_api::DropsReference;
pub use cli_api::McConvergence;
pub use cli_api::McStopReason;
pub use cli_api::MonteCarloParams;
pub use cli_api::MonteCarloResults;
pub use cli_api::TrajectoryPoint;
pub use cli_api::TrajectoryResult;
pub use cli_api::TrajectorySolver;
pub use cli_api::WindConditions;
pub use cli_api::ZeroCrossings;
pub use cli_api::DEFAULT_HIT_RADIUS_M;
pub use cli_api::MAX_TRAJECTORY_POINTS;
pub use cli_api::MC_ADAPTIVE_ASSUMPTIONS_V1;
pub use cli_api::MC_ADAPTIVE_METHOD_V1;
pub use cli_api::MC_ADAPTIVE_SCHEMA_VERSION_V1;
pub use cli_api::ZERO_RANGE_FROM_ANGLE_MAX_RANGE_M;
pub use cli_api::TARGET_NOT_REACHED_SENTINEL_M;
pub use atmosphere::AtmoSegment;
pub use atmosphere::AtmoSock;
pub use mc_stats::wilson_interval;
pub use mc_stats::ConfidenceLevel;
pub use moving_target::calculate_lead;
pub use moving_target::lead_from_tof;
pub use moving_target::mover_ring;
pub use moving_target::LeadComponents;
pub use moving_target::LeadError;
pub use moving_target::LeadSolution;
pub use solve_json::decode_solve_request_v1;
pub use solve_json::ResolvedSolveRequestV1;
pub use solve_json::SolveErrorCodeV1;
pub use solve_json::SolveErrorEnvelopeV1;
pub use solve_json::SolveRequestV1;
pub use solve_json::SolveSuccessV1;
pub use solve_json::MAX_SOLVE_JSON_SAMPLES_V1;
pub use solve_json::SOLVE_JSON_SCHEMA_VERSION_V1;
pub use solve_v1::solve_v1;
pub use trajectory_observation::TrajectoryObservation;
pub use trajectory_observation::TrajectoryObservationError;
pub use trajectory_observation::TrajectoryObservationFlag;
pub use trajectory_observation::TrajectoryTermination;
pub use trajectory_sampling::MAX_TRAJECTORY_SAMPLES;

Modules§

adjustment
Turret adjustment-unit conversions and click-value parsing (MBA-1355).
aerodynamic_jump
angle_calculations
api_client
HTTP client for Flask API communication
atmosphere
Enhanced atmospheric calculations for ballistics.
bc_estimation
bc_table
bc_table_5d
bc_table_download
BC5D Table Auto-Download Module
card
Shared display-ready row type behind the CLI’s card-shaped table/CSV/JSON surfaces (0.33.0 decision-support Plan B Task 9).
cli_api
cluster_bc
Cluster-based BC degradation for improved accuracy
constants
Physical constants used in ballistics calculations.
credentials
CLI credential store for the online API Personal Access Token (PAT).
derivatives
drag
drag_file
Cleanroom parser for the .drg drag-curve text file format (MBA-1409).
error_budget
MBA-1347: a per-input error budget and measurement-priority report.
explain
MBA-1345: explain why two fully resolved solutions differ.
fast_trajectory
Fast trajectory solver for longer ranges.
ffi
FFI bindings for iOS/Swift integration
form_factor
Legacy name-based form-factor heuristics.
hold_curve
HoldCurve: a solved, sampled drop-vs-range curve read by interpolation, and the sampled-trajectory helpers it is built on (MBA-1361/MBA-1362).
mc_stats
Streaming moments and Bernoulli intervals for Monte Carlo hit statistics.
monte_carlo
Monte Carlo simulation support with statistical analysis
moving_target
Moving-target lead calculation (MBA-1287).
optic
Turret and reticle geometry: click detents, revolutions, physical travel, current dial state, and reticle hold limits (MBA-1348).
pdf_dope_card
PDF Dope Card Generation Module
perturbation
Request-level perturbation kernel (Phase 1 of the 0.33.0 decision-support train).
pitch_damping
Pitch Damping Moment Physics for Ballistics Calculations
power_factor
Power-factor calculator and per-organization rulebook pass/fail (MBA-1372).
precession_nutation
Precession and Nutation Physics for Ballistic Projectiles
profile_import
Import of third-party ballistic profile files.
recoil
SAAMI free-recoil calculator (MBA-1372).
reticle
MBA-1361: reticle schema, parametric generators, and the hold-point-in-reticle API.
reticle_import
MBA-1440: import Bero’s “Ventum” reticle spec into the engine’s ReticleDescription.
reynolds
Reynolds-number utilities and a legacy correction for genuinely low-Re flow.
solve_json
Versioned, binding-neutral JSON data-transfer objects for trajectory solves.
solve_v1
Transport-free implementation of the solve-json v1 trajectory service.
special
Special functions implemented in-crate rather than pulled from a dependency.
spin_decay
Spin Decay Physics for Ballistics Calculations
spin_drift
spin_drift_advanced
stability
stability_advanced
terminal_plot
Zero-dependency terminal chart rendering for trajectory --plot (MBA-1320).
tolerance
MBA-1350: how wrong may one input be before the shot leaves the target?
trajectory_integration
Advanced trajectory integration methods (RK4, RK45)
trajectory_observation
Checked, full-state observations over completed trajectories.
trajectory_sampling
transonic_drag
truing
Velocity / BC truing core (MBA-1343 Phase A).
truing_dsf
Mach-keyed drop-scale-factor (DSF) truing table (MBA-1357).
truing_plan
Observation-range experiment design for joint muzzle-velocity/BC truing (MBA-1346).
truing_uncertainty
Uncertainty-aware joint muzzle-velocity / ballistic-coefficient truing.
truing_wind
MBA-1392: back-solve the effective crosswind from an observed horizontal miss.
wez
WEZ (Weapon Employment Zone) sweep core – MBA-1317, extracted MBA-1343 Phase B.
wind
wind_scenarios
MBA-1349: robust hold corridors across a bounded set of NAMED segmented-wind scenarios.
wind_shear
Altitude-dependent wind shear modeling for ballistics.

Structs§

BCSegmentData

Enums§

DragModel
Drag model enum