Was bored last weekend so I wrote a ballistics solver and turned it into a Monte-Carlo match simulator.
You configure your load (BC, MV, caliber/diameter, drag model), pick a target and distance, then set the random variables: inherent rifle accuracy, muzzle-velocity standard deviation, and wind variability (stdev in mph for different wind components). The simulator fires many shots and shows the distribution of impacts plus an estimated score (including X-counts).
Live demo: https://chasep255.github.io/BallisticsToolkit/target-sim/target-sim.html.
For the technically curious: the ballistic engine is written in C++ and compiled to WebAssembly for fast, client-side performance. It’s a 3-DOF solver (no spin/gyro effects yet) integrated with a Runge-Kutta method, and the web UI is vanilla JavaScript. Build from source requires Emscripten and CMake; see the repo.
GitHub: https://github.com/chasep255/BallisticsToolkit.
If anyone wants to dig in: I’d welcome feedback on the physics model (especially how to best incorporate spin/stability and yaw-drag terms). I also want to try to add a more realistic wind model. Maybe simulate different crosswinds and other effects. Might want to turn it into some sort of video game.
You configure your load (BC, MV, caliber/diameter, drag model), pick a target and distance, then set the random variables: inherent rifle accuracy, muzzle-velocity standard deviation, and wind variability (stdev in mph for different wind components). The simulator fires many shots and shows the distribution of impacts plus an estimated score (including X-counts).
Live demo: https://chasep255.github.io/BallisticsToolkit/target-sim/target-sim.html.
For the technically curious: the ballistic engine is written in C++ and compiled to WebAssembly for fast, client-side performance. It’s a 3-DOF solver (no spin/gyro effects yet) integrated with a Runge-Kutta method, and the web UI is vanilla JavaScript. Build from source requires Emscripten and CMake; see the repo.
GitHub: https://github.com/chasep255/BallisticsToolkit.
If anyone wants to dig in: I’d welcome feedback on the physics model (especially how to best incorporate spin/stability and yaw-drag terms). I also want to try to add a more realistic wind model. Maybe simulate different crosswinds and other effects. Might want to turn it into some sort of video game.