LGPL library for small arms ballistic calculations (Python 3)
Project description
BallisticCalculator
LGPL library for small arms ballistic calculations based on point-mass (3 DoF) plus spin drift.
This repo offers py_ballisticcalc under the more convenient name pyballistic.
Contents
Installation
pip
pip install pyballistic
# Using precompiled backend (improves performance)
pip install pyballistic[exts]
# Using matplotlib and pandas uses additional dependencies
pip install pyballistic[charts]
uv
uv sync
uv sync --dev --extra exts
Docs
To build or serve the complete web documentation, first pip install -e .[docs]. Then:
mkdocs buildwill populate a./sitefolder with HTML.mkdocs servewill build and serve the HTML via local connection.
QuickStart
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 | Dependencies | Description |
|---|---|---|---|
rk4_engine |
Baseline (1x) | None, default | Runge-Kutta 4th-order integration |
euler_engine |
0.5x (slower) | None | Euler 1st-order integration |
verlet_engine |
0.7x (slower) | None | Verlet 2nd-order integration |
cythonized_rk4_engine |
50x (faster) | [exts] |
Compiled Runge-Kutta 4th-order |
cythonized_euler_engine |
40x (faster) | [exts] |
Compiled Euler integration |
scipy_engine |
10x (faster) | scipy |
Advanced numerical methods |
RISK NOTICE
The library performs numerical approximations of complex physical processes. The calculation results MUST NOT be considered as completely and reliably reflecting real-world 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyballistic-2.2.0rc1.tar.gz.
File metadata
- Download URL: pyballistic-2.2.0rc1.tar.gz
- Upload date:
- Size: 120.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00070f126360d32aea17d443604d68f4a23918d5e0318178628219d84f9e8e46
|
|
| MD5 |
71a9d856b5a5a3a7eedc8252c5cf3a4c
|
|
| BLAKE2b-256 |
5d3fc7de12e33b9e02a31d9eb0618eedf89bf9297212f3157b9bebeecd5fb357
|
Provenance
The following attestation bundles were made for pyballistic-2.2.0rc1.tar.gz:
Publisher:
pypi-publish.yml on dbookstaber/pyballistic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyballistic-2.2.0rc1.tar.gz -
Subject digest:
00070f126360d32aea17d443604d68f4a23918d5e0318178628219d84f9e8e46 - Sigstore transparency entry: 521568174
- Sigstore integration time:
-
Permalink:
dbookstaber/pyballistic@21df436ccc40c36ffed2dedee748447fe1032c75 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/dbookstaber
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@21df436ccc40c36ffed2dedee748447fe1032c75 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyballistic-2.2.0rc1-py3-none-any.whl.
File metadata
- Download URL: pyballistic-2.2.0rc1-py3-none-any.whl
- Upload date:
- Size: 131.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cfe03987f3ea4d8754441c4e00a1ecd15d5143f44c0ec0ed31ed611e0c136c2
|
|
| MD5 |
29496efb09f981f810d1162f5b1a5a49
|
|
| BLAKE2b-256 |
be8583f879a69964019071338c8c3f5a30bff47ad64b2504ec4da762b12d4877
|
Provenance
The following attestation bundles were made for pyballistic-2.2.0rc1-py3-none-any.whl:
Publisher:
pypi-publish.yml on dbookstaber/pyballistic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyballistic-2.2.0rc1-py3-none-any.whl -
Subject digest:
1cfe03987f3ea4d8754441c4e00a1ecd15d5143f44c0ec0ed31ed611e0c136c2 - Sigstore transparency entry: 521479059
- Sigstore integration time:
-
Permalink:
dbookstaber/pyballistic@21df436ccc40c36ffed2dedee748447fe1032c75 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/dbookstaber
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@21df436ccc40c36ffed2dedee748447fe1032c75 -
Trigger Event:
release
-
Statement type: