Skip to content

A real-time 3D visualization of satellite orbits, collision detection, and predictive analysis — built with React, CesiumJS, and Clean Architecture

Notifications You must be signed in to change notification settings

Aliromia21/orbital-collision-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛰️ Orbital Collision Simulation

A real-time 3D visualization of satellite orbits, collision detection, and predictive analysis — built with React, CesiumJS, and Clean Architecture.


Preview

App Preview App Preview

🌍 Overview

This project simulates and visualizes satellite orbits around Earth, detecting potential collisions and predicting future close approaches (TCA — Time of Closest Approach).

It demonstrates a real-time orbital mechanics system with:

  • Dynamic 3D visualization using CesiumJS.
  • Real-time collision detection.
  • Predictive algorithms for close approaches.
  • Visual and textual alert panels.
  • An event log of all detected collisions.

🧠 Core Algorithms

This simulation is driven by simplified orbital mechanics and vector mathematics to approximate real satellite motion.

1️⃣ Orbital Position Calculation — satelliteECEFAtTime()

Each satellite’s position in ECEF coordinates is computed using circular orbit equations:

[ r = R_{Earth} + altitude ] [ u = u_0 + n \cdot t \quad \text{where } n = \sqrt{\frac{\mu}{r^3}} ] [ r_{ECEF} = R_z(\Omega_E \cdot t) \cdot R_z(RAAN) \cdot R_x(inc) \cdot r_{orb} ]

Where:

  • ( \mu = 3.986 \times 10^{14} ) m³/s² (Earth’s gravitational parameter)
  • ( \Omega_E ) = 7.292115 × 10⁻⁵ rad/s (Earth’s rotation rate)

This ensures satellites orbit while Earth rotates underneath.


2️⃣ Instant Collision Detection — detectInstantCollisions()

At every simulation step, all satellite pairs are compared: [ d = ||r_A - r_B|| ] If ( d < \text{thresholdKm} ), a real-time alert is raised.

This is a pairwise Euclidean distance check using Cesium’s Cartesian3.distance().


3️⃣ Predictive Collision Estimation — predictCloseApproaches()

To predict future near-misses, relative motion is modeled as: [ r(t) = r_0 + v \cdot t ] The time of minimum distance: [ t^* = -\frac{r_0 \cdot v}{v \cdot v} ] Then: [ d_{min} = ||r_0 + v \cdot t^*|| ] If ( d_{min} < \text{tcaThresholdKm} ), it’s added as a predicted TCA event.

This approach is computationally light, suitable for real-time visualization.


🧩 Clean Architecture Design

The project follows the Clean Architecture pattern to separate business logic from the presentation layer:

✅ Each layer has a clear responsibility:

  • Domain: Pure math & physics logic
  • Application: Simulation control flow
  • Presentation: React + CesiumJS visualization

⚙️ Technologies

Category Technology
UI Layer React 18 + Resium
3D Engine CesiumJS
Architecture Clean Architecture
Language JavaScript (ES6+)
Styling CSS + custom animations

🛰️ Features

  • Real-time orbital visualization (Cesium 3D globe).
  • Dynamic orbit trails with glow effects.
  • Instant collision detection with alert overlays.
  • Predictive close-approach modeling (TCA).
  • Log of all detected collision events.
  • Follow mode for individual satellites.
  • Floating/space-like visual effects via CSS.

🧭 How to Run

# 1️⃣ Install dependencies
npm install

# 2️⃣ Start the development server
npm start

📊 Example Simulation Setup

To make collisions happen early for testing, two satellites are initialized with opposite orbital inclinations (0° and 180°) and similar altitudes (400 km).
This guarantees an intersection near the equator within the first simulation minute.


🧮 Mathematical References

  • Vallado, D. A., Fundamentals of Astrodynamics and Applications (4th Edition).
  • Curtis, H. D., Orbital Mechanics for Engineering Students.
  • NASA Conjunction Data Message (CDM) format for TCA representation.

🧑‍💻 Author

Ali Romia
💼 Software Developer

📜 License

MIT License — Free to use, modify, and distribute with credit.


🌌 Inspiration

This project was inspired by real-world satellite conjunction analysis systems (NASA, ESA, SpaceX Starlink), simplified for interactive visualization and educational use.

About

A real-time 3D visualization of satellite orbits, collision detection, and predictive analysis — built with React, CesiumJS, and Clean Architecture

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published