ballistics.foo
// Interactive Ballistics Playground
Explore ballistics physics through code, powered by Rust and WebAssembly
What is ballistics.foo?
ballistics.foo is an interactive web-based playground for learning about ballistics physics and modern web technologies. It combines a professional-grade ballistics calculation engine with a multi-language programming environmentβall running entirely in your browser.
Whether you're a shooter curious about trajectory calculations, a developer exploring WebAssembly, or a student learning physics, ballistics.foo provides a hands-on environment to experiment and learn.
Educational Mission: Our goal is to make ballistics physics accessible and understandable through interactive code examples. By seeing the math in action and modifying parameters in real-time, users can build intuition about how projectiles behave.
Features
π― Professional Ballistics Engine
High-precision trajectory calculations with drag models, wind drift, spin drift, Coriolis effect, and more.
π Multi-Language Support
Run ballistics calculations in JavaScript, Python, Ruby, or PHPβall in the browser.
β‘ Lightning Fast
Powered by WebAssembly for near-native performance. Complex calculations run in milliseconds.
π Privacy First
All calculations run locally in your browser. We don't see or store your data.
π Interactive Examples
Pre-loaded code examples to get started immediately. Modify and experiment freely.
π Free and Open Source
The ballistics engine is open source (MIT OR Apache-2.0). No accounts, no paywalls.
Technology Stack
Core Engine:
The ballistics calculations are powered by the Ballistics Engine, a high-performance Rust library compiled to WebAssembly.
Rust
WebAssembly
wasm-pack
wasm-bindgen
Language Runtimes:
Multiple programming languages run directly in the browser:
JavaScript (Native)
Pyodide (Python)
ruby.wasm (Ruby)
php-wasm (PHP)
User Interface:
A clean, developer-focused interface built with:
Monaco Editor
Vanilla JavaScript
CSS Grid/Flexbox
Why WebAssembly?
- Performance: Near-native speed for complex calculations
- Portability: Run the same code on web, mobile, desktop
- Safety: Sandboxed execution with memory safety
- Language Agnostic: Call Rust code from any language
Who is this for?
π Students and Educators
- Learn about projectile motion and aerodynamics
- Visualize how different factors affect trajectory
- Experiment with physics concepts interactively
- Understand drag coefficients and ballistic coefficients
π¨βπ» Developers
- Explore WebAssembly technology
- Learn how to call Rust from JavaScript, Python, Ruby, or PHP
- See real-world WASM performance benefits
- Study the open-source engine implementation
π― Shooters and Reloaders
- Calculate trajectories for different loads
- Understand wind drift and environmental effects
- Compare different bullet ballistic coefficients
- Learn about advanced ballistics concepts (spin drift, Coriolis)
π¬ Researchers
- Quick ballistics calculations for papers or projects
- Test sensitivity to different parameters
- Generate trajectory data programmatically
- Integrate into larger workflows via the API
The Ballistics Engine
ballistics.foo is powered by the Ballistics Engine, a professional-grade Rust library for external ballistics calculations.
Key Capabilities:
- Drag Models: G1, G2, G5, G6, G7, G8, GI, GS support
- Environmental Modeling: Temperature, pressure, humidity, altitude corrections
- Advanced Effects: Spin drift, Coriolis effect, aerodynamic jump
- Wind Modeling: Constant and variable wind profiles
- Zero Calculations: Automatic sight adjustments
- Energy and Momentum: Kinetic energy, momentum, recoil calculations
Physics Models:
The engine implements several ballistics models:
- Point Mass Model: Fast, simple trajectory calculations
- 4DOF Model: Four Degrees of Freedom with pitch damping and spin decay
Open Source: The ballistics engine source code is available on GitHub under dual MIT and Apache-2.0 licenses. Contributions welcome!
Two Ways to Use the Engine
1. CLI-Style Interface
Simple command-line style interface. Great for quick calculations and demos:
const ballistics = new ballisticsEngine.WasmBallistics();
const result = ballistics.runCommand(
"ballistics trajectory -b 0.505 -v 2789 --drag-model G7 -r 600"
);
console.log(result);
2. Object-Oriented API
Fluent API with method chaining. Type-safe and developer-friendly:
const calc = new ballisticsEngine.Calculator()
.setBC(0.505)
.setVelocity(2789)
.setDragModel('G7')
.setWind(10, 90)
.setZeroRange(200);
const result = calc.calculateTrajectory(600);
console.log(`Drop: ${result.drop_inches}" | Drift: ${result.drift_inches}"`);
Safety and Responsible Use
Educational Tool Only: ballistics.foo provides estimates for educational purposes. Calculations should not be relied upon for actual shooting scenarios without independent verification.
Please review our Safety Disclaimer before using ballistics calculations. Key points:
- All calculations are mathematical estimates
- Real-world results vary due to many factors
- Verify all data independently in safe, controlled conditions
- Follow all firearms safety rules and regulations
- Comply with all applicable laws in your jurisdiction
- Seek professional training and advice
See our Terms of Service for complete legal terms.
Project Background
Why ballistics.foo?
This project was born from the intersection of three interests:
- Ballistics: A fascination with the physics of projectile motion
- Rust and WebAssembly: Exploring modern web technologies and performance
- Education: Making complex physics concepts accessible through interactive tools
Traditional ballistics software often requires desktop installation, has outdated interfaces, or lacks educational focus. We wanted to create something that:
- Runs entirely in the browser (no installation)
- Provides instant feedback and experimentation
- Supports multiple programming languages
- Is fast, accurate, and open source
- Respects user privacy (client-side only)
Development Philosophy
- Performance First: Rust + WebAssembly for maximum speed
- Privacy Focused: All calculations run locally; we don't see your data
- Open Source: Transparent, auditable, improvable by the community
- Educational: Clear examples and documentation
- Accessible: Free, no accounts, works on any modern browser
Future Plans
Upcoming Features:
- π Interactive trajectory visualization and charts
- π― Ballistic coefficient estimation from measured data
- π‘οΈ Expanded environmental modeling
- π± Mobile-optimized interface
- π Comprehensive tutorial series
- πΎ Save and share calculations (privacy-preserving)
- π API endpoints for integration
Want to Contribute?
The ballistics engine is open source! Contributions are welcome:
- GitHub: github.com/ajokela/ballistics-engine
- Report Bugs: Open an issue on GitHub
- Suggest Features: Discussions and feature requests welcome
- Improve Documentation: Help make the project more accessible
- Submit Code: Pull requests for bug fixes and enhancements
Credits and Acknowledgments
Created By:
Alex Jokela - Developer, ballistics enthusiast, and Rust advocate
Built With:
- Rust Programming Language - The foundation of the ballistics engine
- WebAssembly - Bringing near-native performance to the web
- Pyodide Project - Python in the browser
- ruby.wasm Team - Ruby runtime for WebAssembly
- PHP.wasm Project - PHP in WebAssembly
- Monaco Editor - VS Code's editor in the browser
Inspired By:
- Applied Ballistics - Professional ballistics research and education
- Bryan Litz - Pioneering work in modern ballistics
- The Rust and WebAssembly communities
- Open source ballistics software projects
Contact
Get in Touch:
Follow the Project:
License
The ballistics engine is dual-licensed under your choice of:
Both licenses allow:
- β
Commercial use
- β
Modification
- β
Distribution
- β
Private use
See the full license text for details.
The website content and design are Β© 2025 Alex Jokela.
β Back to Playground