Real-time numerical solver for moving target interception with realistic ballistic trajectory
Project description
ballistic-solve is a high-performance C++ library with Python bindings for computing ballistic trajectories and firing solutions. It solves intercept problems for moving targets while modeling real-world physics including gravity, drag, wind, and atmospheric variations.
Key Features
- Real-world physics — Account for gravity, air resistance, wind, and atmospheric conditions
- Moving targets interception — Calculate firing solutions to intercept targets with any motion pattern
- High performance — Fast C++ core with Eigen for real-time trajectory computation
Installation
pip install ballistic-solve
Quick Start
import numpy as np
from ballistic_solve import Ballistic, Environment, Projectile
environment = Environment.earth_standard()
projectile = Projectile.gsh30_round()
ballistic = Ballistic(environment, projectile)
def target_position(t):
p = np.array([1200.0, 150.0, 5200.0])
v = np.array([270.0, 20.0, -5.0])
a = np.array([0.0, -15.0, -2.0])
return p + v * t + 0.5 * a * t**2
solution = ballistic.solve_earliest(
target_position=target_position,
platform_position=np.array([0.0, 0.0, 5000.0]),
platform_velocity=np.array([250.0, 0.0, 0.0]),
projectile_speed=860.0,
time_range=(0.0, 5.0)
)
if solution:
print(f"Fire direction: {solution.direction}")
print(f"Time to intercept: {solution.time:.3f}s")
print(f"Interception error: {solution.error:.4e}m")
print(f"Computation time: {solution.computation_time * 1e3:.2f}ms")
else:
print("No solution")
Dependencies
- Eigen — Vectorized linear algebra and Levenberg-Marquardt optimization
- Boost — Adaptive-step ODE integration and root-finding
License
MIT © Ariyudo Pertama
Project details
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 ballistic_solve-0.2.0.tar.gz.
File metadata
- Download URL: ballistic_solve-0.2.0.tar.gz
- Upload date:
- Size: 62.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43a42d9314171ad453d0bacb073866b4bca19acb56599e40fa839ae3c0be421d
|
|
| MD5 |
da7e6b51deb539692fbf5b251c53fd27
|
|
| BLAKE2b-256 |
b5e48aedb3e328b40f754261464b29179b5b3edb999a477afbc8ec232bfc0f34
|
File details
Details for the file ballistic_solve-0.2.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: ballistic_solve-0.2.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 133.2 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b53c079f0efc01719bac143e28cfd55c95ada042dc072996173f8b605ec95cf
|
|
| MD5 |
dc92ee1f55b7b83f81cf6f715b4a896b
|
|
| BLAKE2b-256 |
a6a6b7e6f6c4a8e18ae87bf59a93060314fc74175015b286c23784fb3c1c87fb
|