Skip to main content

Real-time numerical solver for moving target interception with realistic ballistic trajectory

Project description

hero-dark

CI PyPI Python 3.9+ C++ License: MIT

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

ballistic_solve-0.2.2.tar.gz (366.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ballistic_solve-0.2.2-cp313-cp313-win_amd64.whl (482.2 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file ballistic_solve-0.2.2.tar.gz.

File metadata

  • Download URL: ballistic_solve-0.2.2.tar.gz
  • Upload date:
  • Size: 366.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for ballistic_solve-0.2.2.tar.gz
Algorithm Hash digest
SHA256 111e97ce7973a817554d68af69593b0538f435ea7350d0abdfce34698832ad2f
MD5 b7269fe70031d78631be17a5d3a96160
BLAKE2b-256 8808562d3d67ef94f326f0c9527ca510ebd12be2b90ee5b3d52d9273d0569420

See more details on using hashes here.

File details

Details for the file ballistic_solve-0.2.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for ballistic_solve-0.2.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c2c0a264212698957b4b94185ab56a2dcd82dad710bd73362988a9afeeff13cb
MD5 1f343e44f3eddf398f656b2cd635bbfc
BLAKE2b-256 05cd86a46042733e20bfa980e144329aecc0a9c6668eeccdc97c2ddea485204e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page