Skip to main content

favicon Ballistic Solver Library

LGPL library for small arms ballistic calculations based on point-mass (3 DoF) plus spin drift.

license pypi pypi-pre downloads downloads/month coverage py-versions Made in Ukraine

powered by bclibc powered by pyodide

Pre-commit Pytest RK4 Python Euler Pytest Euler (Cython) Pytest RK4 (Cython) Pytest Verlet (Cython) Pytest Scipy

Contents

Installation

uv

uv add py-ballisticcalc

# Using precompiled backend (improves performance)
uv add py-ballisticcalc[exts]

# Using matplotlib and pandas uses additional dependencies
uv add py-ballisticcalc[charts]

# Get everything, including the SciPy engine
uv add py-ballisticcalc[exts,charts,scipy]

pip

pip install py-ballisticcalc

# Using precompiled backend (improves performance)
pip install py-ballisticcalc[exts]

# Using matplotlib and pandas uses additional dependencies
pip install py-ballisticcalc[charts]

# Get everything, including the SciPy engine
pip install py-ballisticcalc[exts,charts,scipy]

Quick Start - click here to open Quick Start guide

Interactive Web REPL

Prefer to try it before installing anything? Open the Interactive Web REPL — runs entirely in your browser via Pyodide.

Examples

Ballistic Concepts

Units

Work in your preferred terms with easy conversions for the following dimensions and units:

  • Angular: radian, degree, MOA, mil, mrad, thousandth, inch/100yd, cm/100m, o'clock
  • Distance: inch, foot, yard, mile, nautical mile, mm, cm, m, km, line
  • Energy: foot-pound, joule
  • Pressure: mmHg, inHg, bar, hPa, PSI
  • Temperature: Fahrenheit, Celsius, Kelvin, Rankine
  • Time: second, minute, millisecond, microsecond, nanosecond, picosecond
  • Velocity: m/s, km/h, ft/s, mph, knots
  • Weight: grain, ounce, gram, pound, kilogram, newton

Calculation Engines

Choose between different calculation engines, or build your own. Included engines:

Engine Name Speed (Find Zero / Trajectory) Dependencies Description
[rk4_engine][py_ballisticcalc.engines.RK4IntegrationEngine] Baseline (1x) None; default Runge-Kutta 4th-order integration
[euler_engine][py_ballisticcalc.engines.EulerIntegrationEngine] :material-arrow-down: 0.5x / 0.5x (slower) None Euler 1st-order integration
[verlet_engine][py_ballisticcalc.engines.VelocityVerletIntegrationEngine] :material-arrow-down: 0.8x / 0.8x (slower) None Verlet 2nd-order symplectic integration
[cythonized_rk4_engine][py_ballisticcalc_exts.CythonizedRK4IntegrationEngine] :material-arrow-up: 112x / 200x (faster) [exts] Compiled Runge-Kutta 4th-order
[cythonized_euler_engine][py_ballisticcalc_exts.CythonizedEulerIntegrationEngine] :material-arrow-up: 47x / 65x (faster) [exts] Compiled Euler integration
[cythonized_verlet_engine][py_ballisticcalc_exts.CythonizedVelocityVerletIntegrationEngine] :material-arrow-up: 157x / 100x (faster) [exts] Compiled Verlet 2nd-order symplectic
[scipy_engine][py_ballisticcalc.engines.SciPyIntegrationEngine] :material-arrow-up: 6.2x / 5.8x (faster) [scipy] Advanced numerical methods

About project

The library provides trajectory calculation for ballistic projectiles launched by airguns, bows, firearms, artillery, etc.

The core point-mass (3DoF) ballistic model underlying this project was used on the earliest digital computers. Robert McCoy (author of Modern Exterior Ballistics) implemented one in BASIC. JBM published code in C. Nikolay Gekht ported that to C#, extended it with formulas from Bryan Litz's Applied Ballistics, and ported it to Go, while Alexandre Trofimov implemented a calculator in JavaScript.

This Python3 implementation has been expanded to support multiple ballistic coefficients and custom drag functions, such as those derived from Doppler radar data.

Contributors

This project exists thanks to all the people who contribute.

Special thanks to:

  • David Bookstaber - Ballistics Expert
    For help understanding and improving the functionality
  • Serhiy Yevtushenko - Applied Mathematician
    For helping in consultations, testing, and improving edge case compatibility
  • Nikolay Gekht
    For the source code in C# and GO-lang from which this project firstly was forked

Sister projects

  • bclibc - High performance C++/C99 Ballistic solver engine
  • micropython-bclibc - Pure C99 Ballistic Solver Engine for MicroPython (bclibc subset)
  • ebalistyka - Ballistic Calculator built with Flutter and high performance C++ engine
  • js-ballistics - ISC library for small arms ballistic calculations (JavaScript ES6+)

License

Copyright (C) 2023 Yaroshenko Dmytro (o-murphy)

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License v3.0 as published by the Free Software Foundation.

See LICENSE for the full text. See CHANGELOG for release history.

[!NOTE] bclibc (the ballistic solver engine, located in py_ballisticcalc_exts/external/bclibc) is licensed separately under the GNU Lesser General Public License v3.0. See py_ballisticcalc_exts/external/bclibc/LICENSE.

[!WARNING]

RISK NOTICE

This library performs approximate simulations of complex physical processes. Therefore, the calculation results MUST NOT be considered as completely and reliably > reflecting actual behavior of projectiles. While these results may be used for educational purpose, they must NOT be considered as reliable for the areas where incorrect calculation may cause making a wrong decision, financial harm, or can put a human life at risk.

THE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.

Release files for py-ballisticcalc 2.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-ballisticcalc 2.3.1
File Size Uploaded
py_ballisticcalc-2.3.1.tar.gz 6.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-ballisticcalc 2.3.1
File Interpreter ABI Platform
py_ballisticcalc-2.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.9 MB

Release files / py_ballisticcalc-2.3.1.tar.gz

Download URL py_ballisticcalc-2.3.1.tar.gz
Size 6.8 MB
Tags Source
SHA-256 checksum
How to use checksums
2f3dc9f50d4d80f819339ac6e27f2a2d24266873558bba00653e351402a60540
BLAKE2b-256 checksum
How to use checksums
faa9a68bf3f210cacd319838986800854a7b43f5bd41908981838a08b410976d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release files / py_ballisticcalc-2.3.1-py3-none-any.whl

Download URL py_ballisticcalc-2.3.1-py3-none-any.whl
Size 146.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
394f223c0800685b2e6119b49cd2cb440fc6940a373692fd66d0242428184d71
BLAKE2b-256 checksum
How to use checksums
c10e79a509a1dbdc934ee4328e8d987705b937055640d4fcf088c36a42678783
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.3.1 This release

2 release files

2.3.0

2 release files

2.2.10

2 release files

2.2.9

2 release files

2.2.8

2 release files

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.12

2 release files

1.0.11

1 release file

1.0.10

1 release file

1.0.9

4 release files

1.0.4

3 release files

1.0.0

3 release files

0.2.3

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page