Mach Simulator
A client-side computational tool for simulating the trajectories of hypersonic cruise missiles and ballistic missiles launched between arbitrary geographic coordinates. The simulator computes great-circle distances using the Haversine formula, generates point-by-point trajectory profiles accounting for atmospheric density variations, gravitational effects, and aerodynamic drag, and performs interception feasibility analysis against configurable air defense systems.
The system models two fundamentally different flight profiles: ballistic trajectories following sub-orbital parabolic arcs with boost, midcourse, and terminal phases; and hypersonic cruise trajectories maintaining sustained atmospheric flight at Mach 5+ with skip-glide oscillation patterns. All computations run entirely in the browser with no server-side processing.
This simulator is intended for educational and illustrative purposes only. All missile specifications, defense system parameters, and computed results are approximate and should not be considered operationally accurate.
Geodesic Computation
The fundamental distance computation uses the Haversine formula, which calculates the great-circle distance between two points on a sphere. While not accounting for Earth's oblate spheroid shape (up to ~0.3% error), it provides sufficient accuracy for trajectory simulation.
Haversine Distance
c = 2 · atan2(√a, √(1−a))
d = R · c
Initial Bearing (Azimuth)
Each trajectory point is projected along the great-circle arc using the destination point formula:
λ₂ = λ₁ + atan2(sin(θ) · sin(d/R) · cos(φ₁), cos(d/R) − sin(φ₁) · sin(φ₂))
Atmospheric Model
A simplified but physically meaningful atmospheric model combining an exponential density profile with an ISA (International Standard Atmosphere) temperature model.
Density Profile
Accurate to within ~5% up to approximately 80 km altitude. Above the Karman line (100 km), the atmosphere is effectively negligible for drag purposes.
Speed of Sound (ISA)
where γ = 1.4, R₁ = 287 J/(kg·K), and T(h) follows a piecewise model:
Ballistic Trajectory Model
Ballistic missiles follow sub-orbital trajectories consisting of three distinct phases: boost (powered ascent), midcourse (unpowered inertial flight through the upper atmosphere or space), and terminal (atmospheric reentry and descent to target).
Apogee Calculation
Launch Angle
For an ideal vacuum trajectory, the optimal angle for maximum range is 45°. With atmospheric drag and Earth rotation, real missiles typically launch at 30–40°.
Flight Time Estimation
where η = 0.85 accounts for non-ideal trajectory effects (drag losses, gravity turn, Earth curvature).
Altitude Profile
Parabolic function of the path fraction f ∈ [0, 1]. Produces h(0) = 0, h(0.5) = H_apogee, h(1) = 0.
Velocity Profile by Phase
BOOST
Progressive acceleration from 0.2M to full Mach. Duration equals configured burn time (50–190s depending on class).
MIDCOURSE
Inertial flight at ~0.95M, rising to 1.1M during descent due to gravitational acceleration.
TERMINAL
High-speed reentry at ~1.1M, decelerating to ~0.9M at impact due to increasing atmospheric drag.
Hypersonic Trajectory Model
Hypersonic cruise missiles maintain sustained flight within the upper atmosphere (typically 20–40 km altitude) using scramjet or rocket-ramjet propulsion at speeds exceeding Mach 5.
Cruise Speed at Altitude
At a typical cruise altitude of 25 km, c ≈ 298 m/s, so Mach 8 corresponds to approximately 2,384 m/s (8,582 km/h).
Flight Phases
BOOST
~90 secondsClimb to cruise altitude with smooth acceleration using ease-in-out interpolation.
v(t) = M · 0.3 + M · 0.7 · easeInOut(t / t_boost)
CRUISE
Bulk of flight timeNear-horizontal flight with skip-glide oscillations. Three sinusoidal cycles with 15% altitude amplitude.
v(t) = M · (0.95 + 0.05 · sin(f · 8π))
TERMINAL
~50 km to targetSteep dive toward target with velocity increasing up to ~1.15M due to gravitational acceleration and potential energy conversion.
Ease-In-Out Function
Aerodynamic Forces
Three key aerodynamic quantities are computed at each trajectory point.
Dynamic Pressure
At Mach 8 and 25 km altitude: ρ ≈ 0.040 kg/m³, v ≈ 2,384 m/s, yielding q ≈ 113 kPa — requiring advanced thermal protection systems.
Drag Force
Drag Deceleration
Interception Analysis
The interception analysis evaluates whether a given defense system can successfully engage a missile along its computed trajectory through three stages: envelope matching, engagement window computation, and probability estimation.
Engagement Envelope
For each trajectory point, three conditions are checked:
Optimal Intercept Point
Each factor normalized to [0, 1]. Speed is weighted 40% as it most affects Pk.
Engagement Window
Must exceed the system's reaction time (t_react). Systems like the S-500 have reaction times as low as 4 seconds, while Aegis BMD requires up to 15 seconds.
Probability of Kill (Pk)
The core metric of interception analysis. A multi-factor model degrades the system's baseline Pk according to engagement conditions.
Single-Shot Pk
Cubic penalty. A target at 90% of the system's speed limit retains only 27% of this factor.
Quadratic penalty toward envelope edges. Peak performance at midpoint of altitude range.
Hypersonic vehicles are harder to intercept due to unpredictable lateral maneuvers.
Reaches 1.0 when engagement window is at least 3x the reaction time.
Salvo Probability
Assumes independent shot attempts. Example: Pk_single = 0.3, N = 4 interceptors:
Missile Configurations
12 pre-configured missiles (6 hypersonic, 6 ballistic) plus 2 fully customizable configurations.
| Name | Country | Mach | Range (km) | Cruise Alt (km) | CEP (m) |
|---|---|---|---|---|---|
| Kh-47M2 Kinzhal | Russia | 5-10 | 2,000 | 20 | 10 |
| 3M22 Zircon | Russia | 5-9 | 1,000 | 28 | 15 |
| DF-ZF (WU-14) | China | 5-10 | 2,500 | 30 | 20 |
| Agni-P HGV | India | 5-8 | 2,000 | 25 | 25 |
| AGM-183A ARRW | USA | 5-8 | 1,600 | 25 | 8 |
| Custom | Any | 3-25 | 5,000 | 30 | 15 |
| Name | Country | Class | Mach | Range (km) | Apogee Factor | Burn (s) |
|---|---|---|---|---|---|---|
| Iskander-M | Russia | SRBM | 4-7.5 | 500 | 0.40 | 50 |
| DF-21D | China | MRBM | 6-10 | 1,800 | 0.50 | 80 |
| Minuteman III | USA | ICBM | 15-23 | 13,000 | 0.25 | 180 |
| Topol-M | Russia | ICBM | 15-22 | 11,000 | 0.25 | 190 |
| Shaheen-III | Pakistan | IRBM | 8-14 | 2,750 | 0.35 | 120 |
| Custom | Any | Any | 2-25 | 15,000 | 0.30 | 120 |
Defense System Configurations
Seven defense systems modeled, spanning from short-range point defense to exo-atmospheric ballistic missile defense.
| Name | Country | Type | Range (km) | Alt (km) | Max Target | Pk Base | React (s) |
|---|---|---|---|---|---|---|---|
| S-400 Triumf | Russia | SAM | 2-400 | 0.01-30 | M14.5 | 90% | 9 |
| Patriot PAC-3 | USA | SAM | 3-160 | 0.06-25 | M8 | 80% | 9 |
| THAAD | USA | TMD | 50-200 | 40-150 | M14 | 95% | 12 |
| Iron Dome | Israel | SHORAD | 4-70 | 0.03-10 | M3 | 85% | 4 |
| Aegis SM-3 | USA | BMD | 100-700 | 70-500 | M15 | 85% | 15 |
| S-500 Prometey | Russia | ABM | 10-600 | 5-200 | M20 | 92% | 4 |
| Arrow 3 | Israel | ABM | 100-2400 | 40-100 | M15 | 90% | 10 |
Note the trade-offs: THAAD has the highest base Pk (95%) but operates only at 40–150 km altitude. Iron Dome has the fastest reaction time (4s) but can only engage targets below Mach 3. The S-500 has the highest speed ceiling (Mach 20) and fastest reaction time among long-range systems, designed specifically for the anti-hypersonic role.
Software Architecture
Technology Stack
Module Structure
src/
config/
missiles.json # 12 missile configurations
defense-systems.json # 7 defense system specs
scenarios.json # 5 preset scenarios
constants.json # Physical constants
lib/
types.ts # TypeScript type definitions
physics.ts # Haversine, atmospheric model,
# trajectory generation, formulas
interception.ts # Engagement analysis, Pk computation
simulation.ts # Orchestrator combining all models
components/
MissileSelector.tsx # Missile type/model selection
MachControl.tsx # Speed slider with conversions
CoordinateInput.tsx # Lat/lon input + city presets
DefenseSelector.tsx # Defense system selection
InteractiveMap.tsx # Leaflet map with point placement
TrajectoryChart.tsx # Altitude vs distance (canvas)
VelocityChart.tsx # Mach vs time (canvas)
FormulaDisplay.tsx # Step-by-step formula rendering
ResultsPanel.tsx # Summary stats + interception
TimelineSlider.tsx # Scrubber with instantaneous dataData Flow
500 points
6-8 steps