ballistics-engine

High-Performance Rust Crate for External Ballistics

Latest Documentation
MIT Apache-2.0

About ballistics-engine

ballistics-engine is a comprehensive Rust library for high-performance ballistics calculations. Designed for accuracy, speed, and ease of use, it provides everything from basic trajectory calculations to advanced aerodynamic modeling including 4DOF (Four Degrees of Freedom) simulations with aerodynamic jump, spin drift, and Coriolis effects.

High Performance

Written in Rust for maximum speed and memory safety. Optimized algorithms deliver accurate results in microseconds.

Comprehensive Models

Supports G1, G7, and custom drag models. Includes transonic corrections, atmospheric effects, and wind modeling.

Advanced Physics

4DOF trajectory integration, aerodynamic jump, spin decay, pitch damping, and precession/nutation effects.

FFI Bindings

Export to C, Python (PyO3), and WebAssembly. Use the same engine across multiple platforms and languages.

Battle-Tested

Validated against real-world doppler radar data. Extensively tested with 850+ unit and integration tests.

Open Source

Dual-licensed under MIT and Apache-2.0. Contributions welcome on GitHub.

Browse API Documentation View on crates.io GitHub Repository

Quick Start

Add ballistics-engine to your Cargo.toml:

[dependencies]
ballistics-engine = "0.13"

Example usage:

use ballistics_engine::trajectory_solver::solve_trajectory;
use ballistics_engine::DragModel;

let result = solve_trajectory(
    0.505,        // BC (Ballistic Coefficient)
    2800.0,       // Muzzle velocity (ft/s)
    DragModel::G7,
    1000.0,       // Range (yards)
    0.0,          // Zero range
    1.5,          // Sight height (inches)
    0.0,          // Shooting angle
    59.0,         // Temperature (°F)
    29.92,        // Pressure (inHg)
    0.0,          // Humidity (%)
    0.0,          // Wind speed (mph)
    90.0,         // Wind angle (degrees)
);

println!("Drop: {:.2} inches", result.drop_inches);

Core Modules

Explore the complete API documentation organized by module:

Related Projects

ballistics.rs - Main project website with interactive demos
ballistics.sh - Terminal-based ballistics calculator
ballistics.foo - Multi-language WASM playground
ballistics.app - Mobile ballistics application