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.1.tar.gz (366.1 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.1-cp313-cp313-win_amd64.whl (482.4 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

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

File metadata

  • Download URL: ballistic_solve-0.2.1.tar.gz
  • Upload date:
  • Size: 366.1 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.1.tar.gz
Algorithm Hash digest
SHA256 991086368ede8da9274e1be878d7e4d6283d185ea055ad214264d62327bc4b7d
MD5 2c779c4b89e4fe1ce8bdbeeeaae8084b
BLAKE2b-256 38be5f8f5ac217ad593f6b8a2cd4523da99f60eeb3bad6b5e8520829d083d894

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ballistic_solve-0.2.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 75be8237bbec88b1ee459f138c6774b1e25418686beef2408cbc6145003b3e0c
MD5 506bbed7960ce2938e6622039e7ada3e
BLAKE2b-256 61b6b858779d4387e84a4512ac23ce30e166eed4aa623102dc01757fd9d77eab

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