Skip to content

InsaneInfinity/Balistic

Repository files navigation

โฌก BALISTIC V6.0

Advanced Ballistic Fire Control Simulator / Zaawansowany Symulator Balistyczny

License Python CSharp Redis Cesium Leaflet Systems SRTM

๐Ÿ‡ฌ๐Ÿ‡ง A ballistic fire control simulator featuring NASA SRTM terrain masking (real elevation data, horizon scan algorithm), asymmetric blast zones blocked by real mountains, nuclear blast zones, radioactive fallout, cluster munitions, Coriolis effect and hybrid ballistic model. Built as microservices: Python/Flask + C#/.NET + Redis Streams.

๐Ÿ‡ต๐Ÿ‡ฑ Symulator balistyczny z maskowaniem terenowym NASA SRTM (rzeczywiste dane wysokoล›ciowe, algorytm horizon scan), asymetrycznymi strefami raลผenia blokowanymi przez prawdziwe gรณry, strefami jฤ…drowymi, opadem radioaktywnym, gล‚owicami kasetowymi, efektem Coriolisa i hybrydowym modelem balistycznym. Architektura mikrousล‚ug: Python/Flask + C#/.NET + Redis Streams.


๐Ÿ“ท Screenshots

Islamabad SRTM ๐Ÿ”๏ธ Islamabad โ€” Margalla Hills block blast wave NW, flat plain unobstructed SE Las Vegas Red Rock ๐Ÿœ๏ธ Las Vegas / Red Rock Canyon โ€” canyon walls clip zones west, city open east
Jerusalem ๐Ÿ•Œ Jerusalem โ€” Judean Desert extends zones east, Judean Hills clip west DF-41 ICBM 3D ๐ŸŒ DF-41 ICBM โ€” CesiumJS 3D globe trajectory

๐Ÿ†• What's New in v6.0

Feature Description
โ›ฐ๏ธ NASA SRTM Terrain Masking Real elevation data (90m resolution) โ€” 72-ray horizon scan algorithm, blast zones blocked by actual mountains
๐ŸŒ Global SRTM Coverage ~5700 tiles, full world 60ยฐSโ€“60ยฐN offline cache (srtm_cache/)
๐Ÿ”ญ Horizon Scan Algorithm For each of 72 rays: scans terrain profile, detects shadow zones behind ridges
๐Ÿ“ Asymmetric Blast Zones Zones expand freely through valleys, contract against mountain faces
๐Ÿ”๏ธ Elevation Display Impact point elevation shown in panel (e.g. โ›ฐ๏ธ SRTM (1340m n.p.m.))
๐ŸŒฌ๏ธ Fallout Polygon Fix Corrected azimuthโ†’lat/lon conversion โ€” proper wind-aligned elliptical plume
๐Ÿš€ Hybrid Ballistic Model SRBM: Euler+ISA physics; ICBM/IRBM: analytic formulas calibrated to SIPRI/CSIS data
๐Ÿ“Š Realistic ICBM Data Sarmat 9000km: 29.9min, apogee 1080km โœ“ / MM-III 8000km: 28.4min, apogee 960km โœ“
๐Ÿ—ƒ๏ธ weapons_db.json Full weapon database externalized โ€” 195 systems, all parameters

๐Ÿ› ๏ธ Technology Stack

Technology Role
Python 3.10+ / Flask REST API, SRTM terrain masking, weather, heartbeat, PDF export
C# / .NET 10 Ballistic processor โ€” hybrid Euler+analytic model, ISA atmosphere, Coriolis
Redis 7.x Streams Microservices queue (XADD/XREAD) + heartbeat
NASA SRTM Real elevation data via srtm.kurviger.de โ€” 90m global DEM
srtm_module.py Horizon scan terrain masking โ€” auto-downloads tiles on demand
Leaflet.js 1.9.4 2D satellite map โ€” irregular GeoJSON blast polygons
CesiumJS 1.114 3D globe โ€” animated trajectories, Primitive API
OpenStreetMap Overpass Fallback terrain density (when SRTM unavailable)
Google Satellite High-res imagery, English labels
OpenWeatherMap API Real-time wind, pressure, temperature
ReportLab Automated PDF ballistic reports

โš™๏ธ Physics & Science

Source Application
Glasstone & Dolan (1977) Nuclear blast radii โ€” fireball, overpressure zones, thermal burns
NATO FM 6-40 Conventional HE blast zones
ISA Standard Atmosphere Air density by altitude for trajectory simulation
Haversine formula Accurate great-circle distance
Euler integration (dt=1.0s) SRBM trajectory with air drag, Coriolis deflection
SIPRI / CSIS / FAS ICBM calibration data โ€” apogee ratios, flight times
NASA SRTM Real elevation sampling for terrain masking horizon scan

Nuclear Physics โ€” Glasstone & Dolan (1977)

Fireball:      r = 100  ร— W^0.41  [m]
Heavy (20psi): r = 290  ร— W^0.33  [m]
Light  (5psi): r = 690  ร— W^0.33  [m]
Burns (1ยฐ):    r = 2200 ร— W^0.41  [m]

Hybrid Ballistic Model

SRBM / short MRBM (dist < maxRangeSim):
  โ†’ Full Euler+ISA simulation
  โ†’ FindElevationAngle bisection [45ยฐโ€“85ยฐ]
  โ†’ SimulateFlightTime with ISA density layers

ICBM / IRBM (dist > maxRangeSim):
  โ†’ Analytic formulas (calibrated SIPRI/CSIS/FAS):
  angle  = 45ยฐ
  apogee = dist ร— apogeeRatio  (0.06โ€“0.13 by range)
  tof    = dist / (v0 ร— 0.70)  โ† v_avg = 70% burnout velocity

Validation:
  ATACMS  165km, v0=1766: tof=134s  (2.2min), apogee=10km  โœ“
  Iskander 500km, v0=2203: tof=324s  (5.4min), apogee=40km  โœ“
  Sarmat  9174km, v0=7300: tof=1795s (29.9min), apogee=1101km โœ“
  MM-III  8000km, v0=6700: tof=1706s (28.4min), apogee=960km  โœ“

SRTM Terrain Masking โ€” Horizon Scan Algorithm

For each of 72 ray directions (0โ€“360ยฐ):
  elev0 = SRTM elevation at impact point
  max_horizon = -999ยฐ

  For each sample s (0 to n_samples):
    d     = max_blast_radius ร— s / n_samples
    point = impact + d ร— direction
    elev  = SRTM.get_elevation(point)
    angle = atan2(elev - elev0, d)  โ† elevation angle from impact

    if angle > max_horizon:
      max_horizon = angle           โ† new horizon line
    elif max_horizon > 3ยฐ and angle < max_horizon - 3ยฐ:
      shadow_dist = d               โ† terrain blocks wave here
      break

  ray_factor = shadow_dist / max_blast_radius  (0..1)

Polygon: each zone radius ร— ray_factor ร— small noise
Result: asymmetric polygon โ€” contracted against ridges, expanded through valleys

๐Ÿ—บ๏ธ Features

  • โ›ฐ๏ธ NASA SRTM terrain masking โ€” real elevation data, horizon scan, asymmetric blast zones
  • ๐ŸŒ Global offline SRTM cache โ€” ~5700 tiles, auto-download on first shot in region
  • ๐Ÿ”๏ธ Elevation display โ€” impact point elevation shown in terrain panel
  • ๐ŸŒฌ๏ธ Radioactive fallout โ€” corrected wind-aligned elliptical plume, 3 intensity zones
  • ๐Ÿš€ Hybrid ballistic model โ€” physics for SRBM, analytic for ICBM/IRBM
  • ๐Ÿ›ฐ๏ธ Map layer switcher โ€” Hybrid / Satellite / Road (English labels)
  • ๐ŸŽฎ Animated missile flight โ€” real-time trajectory with glowing trail
  • โœˆ๏ธ Nuclear bomber aircraft โ€” animated, realistic altitude 9000-10000m
  • ๐ŸŽฏ Multi-target salvo โ€” mark multiple targets, fire simultaneously
  • ๐Ÿ’“ Heartbeat monitor โ€” C# processor status, FIRE blocked if offline
  • ๐ŸŒ€ Coriolis effect โ€” real deflection based on shooter latitude
  • ๐Ÿ’ฅ Irregular blast zones โ€” 72-ray polygon, terrain-aware
  • โ˜ข๏ธ Nuclear zones โ€” Glasstone & Dolan (1977)
  • ๐Ÿ’ฃ Cluster munitions โ€” elliptical dispersion aligned with flight azimuth
  • ๐Ÿ“Š Shot history โ€” click any shot โ†’ update results panel
  • ๐Ÿ“„ PDF export โ€” full session ballistic report
  • ๐Ÿ” Session token authorization
  • ๐ŸŽฏ GPS target search โ€” geocode address or coordinates โ†’ add as target

๐ŸŒ 195 Systems from 30+ Countries

๐Ÿ‡ต๐Ÿ‡ฑ Poland

Category Systems
Artillery AHS KRAB 155mm (L52), M120 RAK 120mm, Leopard 2 120mm

๐Ÿ‡บ๐Ÿ‡ธ USA

Category Systems
Artillery M109A7 Paladin, M198, M777
Missiles ATACMS-A, HIMARS/GMLRS, PrSM, PAC-3 MSE, SM-3/6, Lance โ˜ข, Pershing II โ˜ข, GLCM โ˜ข, Minuteman III โ˜ข, Trident II D5 โ˜ข, W76-2 โ˜ข
Cruise Tomahawk, JASSM-ER, LRASM, AGM-86 ALCM โ˜ข, AGM-183 ARRW (Mach 20)
Aircraft โœˆ๏ธ B-29 (Little Boy/Fat Man 1945), B-52 โ˜ข, B-1B, F-35A โ˜ข, B-2 Spirit โ˜ข, B-21 Raider โ˜ข, F-15E โ˜ข

๐Ÿ‡ท๐Ÿ‡บ Russia

Category Systems
Artillery 2S19 Msta-S, 2S3 Akacja, 2S7 Pion (203mm), 2S35 Koalicja, 2S1 Gvozdika
Missiles Iskander-M 9M723, Tochka-U, Scud-B, Kinลผaล‚, Rubezh โ˜ข, Sarmat โ˜ข, Bulava โ˜ข, Sinewa โ˜ข, Yars โ˜ข, Topol-M โ˜ข, Avangard โ˜ข
Cruise Kalibr, Oniks, Zircon (Mach 9), Burevestnik โ˜ข, Kh-101, Kh-102 โ˜ข
Aircraft โœˆ๏ธ Tu-160 Blackjack โ˜ข, Tu-95 Bear โ˜ข, Tu-22M Backfire โ˜ข

๐Ÿ‡จ๐Ÿ‡ณ China

Category Systems
Missiles DF-11A, DF-15B, DF-17, DF-21D, DF-26 โ˜ข, DF-27 โ˜ข, DF-31AG โ˜ข, DF-41 โ˜ข, DF-4 โ˜ข, DF-5B โ˜ข
SLBM JL-2 โ˜ข, JL-3 โ˜ข
Cruise CJ-10, YJ-12, DF-100, BrahMos, C-802
Aircraft โœˆ๏ธ H-6K โ˜ข

Other Countries

Country Systems
๐Ÿ‡ฐ๐Ÿ‡ต N. Korea KN-23, Hwasong-12/15/17/18 โ˜ข, Pukguksong-3 โ˜ข
๐Ÿ‡ฎ๐Ÿ‡ท Iran Fateh-110, Zolfaghar, Shahab-3, Khorramshahr, Fattah, Emad, Ghadr
๐Ÿ‡ฎ๐Ÿ‡ฑ Israel Jericho II, Jericho III โ˜ข
๐Ÿ‡ฎ๐Ÿ‡ณ India Agni-V โ˜ข, Agni-VI โ˜ข, K-4 โ˜ข, BrahMos
๐Ÿ‡ต๐Ÿ‡ฐ Pakistan Shaheen-III โ˜ข, Ababeel โ˜ข, Ra'ad โ˜ข
๐Ÿ‡ฌ๐Ÿ‡ง UK Storm Shadow, Trident II โ˜ข, Avro Vulcan B2 โ˜ข โœˆ๏ธ
๐Ÿ‡ซ๐Ÿ‡ท France M51 โ˜ข, SCALP-EG, ASMP-A โ˜ข, Rafale F3 โ˜ข โœˆ๏ธ
๐Ÿ‡ฉ๐Ÿ‡ช Germany PzH 2000, TAURUS KEPD 350, Tornado IDS โ˜ข โœˆ๏ธ
๐Ÿ‡น๐Ÿ‡ท Turkey SOM, Bora, Kasirga
๐Ÿ‡ฐ๐Ÿ‡ท S. Korea K9 Thunder, Hyunmoo-2C/3C/4/5
๐Ÿ‡บ๐Ÿ‡ฆ Ukraine Bohdana, Neptune, Vilkha, Hrim-2
๐Ÿ‡ธ๐Ÿ‡ฆ Saudi Arabia CSS-5 โ˜ข
๐Ÿ‡ธ๐Ÿ‡ช Sweden Archer FH77BW, RBS-15

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    Redis Streams     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    Python / Flask        โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ  โ”‚    C# Processor         โ”‚
โ”‚                          โ”‚  ballistics:stream   โ”‚                         โ”‚
โ”‚  - Leaflet 2D            โ”‚                      โ”‚  - Hybrid ballistic     โ”‚
โ”‚  - CesiumJS 3D globe     โ”‚ โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”‚  - Euler+ISA (SRBM)     โ”‚
โ”‚  - SRTM terrain masking  โ”‚  ballistics:result   โ”‚  - Analytic (ICBM)      โ”‚
โ”‚  - srtm_module.py        โ”‚                      โ”‚  - ISA atmosphere       โ”‚
โ”‚  - Horizon scan          โ”‚   Redis Keys         โ”‚  - Coriolis effect      โ”‚
โ”‚  - /api/terrain route    โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ  โ”‚                         โ”‚
โ”‚  - /health heartbeat     โ”‚  processor:heartbeat โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚  - PDF export            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
  srtm_module.py
  โ”œโ”€โ”€ get_elevation()          โ€” bilinear interpolation from HGT tile
  โ”œโ”€โ”€ terrain_shadowing_factor() โ€” horizon scan per ray
  โ”œโ”€โ”€ compute_blast_radii_with_terrain() โ€” 72-ray polygon generator
  โ””โ”€โ”€ srtm_cache/             โ€” local tile cache (~16GB, gitignored)

๐Ÿš€ Quick Start

git clone https://github.com/InsaneInfinity/Balistic.git
cd Balistic
pip install flask redis requests python-dotenv reportlab numpy srtm.py

Create .env:

WEATHER_API_KEY=your_openweathermap_key
CESIUM_TOKEN=your_cesium_ion_token
# Window 1 โ€” C# processor
dotnet build
dotnet run

# Window 2 โ€” Flask frontend
python balistic_input.py

Login: admin / admin โ†’ http://127.0.0.1:5000

SRTM Setup (optional โ€” tiles download automatically on first shot)

# Test SRTM module
python srtm_module.py

# Pre-download all world tiles (~16GB, ~3h)
python download_srtm_tiles.py

SRTM tiles cached in srtm_cache/ (gitignored). First shot in new region = auto-download (~3s).

Requirements

  • Python 3.10+, .NET 10 SDK
  • Redis 7.x (Memurai for Windows)
  • OpenWeatherMap API key (free)
  • Cesium Ion token (free)
  • numpy, srtm.py (pip install numpy srtm.py)

๐ŸŽฎ Controls

Action Effect
RMB Move shooter
LMB Mark target
FIRE Launch to all targets simultaneously
๐ŸŒ 3D Toggle CesiumJS globe
๐Ÿ›ฐ๏ธ Layer Switch map layer
๐ŸŽฏ GPS Search target by name or coordinates
History click Zoom + update results panel
โฌ‡ PDF Export ballistic report

โš ๏ธ Disclaimer

For educational and simulation purposes only. All data from publicly available sources: Glasstone & Dolan 1977, CSIS Missile Threat, Jane's, NATO FM 6-40, SIPRI, OSINT. Real fire control systems use significantly more complex models.


๐Ÿ“œ License

MIT โ€” use it, modify it, build on it.


๐Ÿ‡ต๐Ÿ‡ฑ Polski

Co nowego w v6.0

Feature Opis
โ›ฐ๏ธ NASA SRTM Rzeczywiste dane wysokoล›ciowe (90m) โ€” algorytm horizon scan, strefy blokowane przez prawdziwe gรณry
๐ŸŒ Globalne pokrycie SRTM ~5700 tile, caล‚y ล›wiat 60ยฐSโ€“60ยฐN w cache offline
๐Ÿ”ญ Horizon Scan 72 promienie, skanowanie profilu terenu, wykrywanie stref cienia za grzbietami
๐Ÿ“ Asymetryczne strefy Strefy rozszerzajฤ… siฤ™ przez doliny, kurczฤ… przy zboczach
๐ŸŒฌ๏ธ Poprawiony opad Poprawiona konwersja azymutโ†’lat/lon โ€” wล‚aล›ciwa elipsa zgodna z wiatrem
๐Ÿš€ Hybrydowy model SRBM: fizyka Euler+ISA; ICBM/IRBM: wzory analityczne kalibrowane SIPRI/CSIS
๐Ÿ“Š Realistyczne ICBM Sarmat 9000km: 29.9min, apogeum 1080km โœ“
๐Ÿ—ƒ๏ธ weapons_db.json Zewnฤ™trzna baza 195 systemรณw

Uruchomienie

git clone https://github.com/InsaneInfinity/Balistic.git
cd Balistic
pip install flask redis requests python-dotenv reportlab numpy srtm.py

Utwรณrz .env:

WEATHER_API_KEY=twรณj_klucz_openweathermap
CESIUM_TOKEN=twรณj_token_cesium_ion
# Okno 1 โ€” procesor C#
dotnet build && dotnet run

# Okno 2 โ€” frontend Flask
python balistic_input.py

Login: admin / admin โ†’ http://127.0.0.1:5000

SRTM (pobieranie automatyczne przy pierwszym strzale)

python srtm_module.py          # test moduล‚u
python download_srtm_tiles.py  # opcjonalne: pobierz caล‚y ล›wiat (~16GB, ~3h)

Tile w srtm_cache/ (w .gitignore). Pierwszy strzaล‚ w nowy region = auto-pobranie (~3s).

Zastrzeลผenie

System wyล‚ฤ…cznie do celรณw edukacyjnych i symulacyjnych. Dane z jawnych ลบrรณdeล‚: Glasstone & Dolan 1977, CSIS, Jane's, NATO FM 6-40, SIPRI, OSINT.

Licencja

MIT โ€” uลผywaj, modyfikuj, rozwijaj.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors