A full-stack application combining physics-based simulation with machine learning
for accurate projectile trajectory prediction and real-time visualization.
Live Demo • API Docs • Features • Quick Start • API Reference
Ballistix is an advanced platform for simulating and predicting projectile and missile trajectories, combining physics-based simulation with machine learning and a modern, interactive UI.
- Modern UI: Dark theme, animated hero, glassmorphism, responsive design
- Navigation: Footer and CTA buttons on the About page now switch views (Home, Ballistic, Analytics, Settings, Launch Simulator)
- Physics Engine: Runge-Kutta 4 integration with ISA atmospheric model
- Machine Learning: Random Forest model with 98% R² accuracy
- Real-time Visualization: Animated trajectory plots, multiple projectile types
- Missile Presets: 20+ real-world missile profiles
| Feature | Description |
|---|---|
| Modern UI | Dark theme, animated hero, glassmorphism, responsive |
| Footer Navigation | Home, Ballistic, Analytics, Settings (About page) |
| Launch Simulator | CTA button launches trajectory simulation |
| Physics Simulation | Newtonian mechanics, altitude-dependent gravity, air density |
| ML Predictions | Random Forest, instant impact predictions |
| Analytics Dashboard | Compare physics vs ML, track accuracy |
| Missile Database | ICBMs, SLBMs, cruise missiles, real specs |
| 3D Globe View | Visualize long-range trajectories |
| User Sessions | Per-user history and settings |
Node.js >= 18.0.0
Python >= 3.10
npm >= 9.0.0Frontend: https://ballistix.vercel.app
API Docs: https://ballistix.onrender.com/docs
# Clone repository
git clone https://github.com/rana-rohit/projectile-prediction.git
cd projectile-prediction
# Backend setup
cd backend
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
# Frontend setup (new terminal)
cd frontend
npm install
npm run devAccess:
- Frontend: http://localhost:5173
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs
projectile-prediction/
├── backend/
│ ├── app/
│ │ ├── main.py # FastAPI API endpoints
│ │ ├── sim.py # Physics engine (RK4 + ISA)
│ │ ├── model_store.py # ML model management
│ │ ├── database.py # SQLAlchemy config
│ │ └── db_models.py # Data models
│ ├── models/
│ │ ├── rf_model.joblib # Trained Random Forest
│ │ ├── scaler.joblib # Feature scaler
│ │ └── model_metadata.json
│ ├── requirements.txt
│ └── runtime.txt
│ └── static/
│ └── ballistic/ # Static previews
│
├── frontend/
│ ├── src/
│ │ ├── app.jsx # Main app & routing
│ │ ├── Ballistic.jsx # Missile simulation
│ │ ├── analytics.jsx # Analytics dashboard
│ │ ├── About.jsx # Modern landing page (with navigation)
│ │ ├── Settings.jsx # User preferences
│ │ ├── Auth.jsx # Authentication
│ │ ├── AnimationCanvas.jsx
│ │ └── styles.css # Global styles
│ ├── index.html
│ ├── vercel.json
│ └── package.json
│
├── DEPLOYMENT.md
├── LICENSE
└── README.md
The simulation uses Runge-Kutta 4 (RK4) numerical integration with:
dx/dt = vₓ
dy/dt = vᵧ
dvₓ/dt = -k·(ρ/ρ₀)·|v|·vₓ
dvᵧ/dt = -g(h) - k·(ρ/ρ₀)·|v|·vᵧ
| Altitude | Layer | Model |
|---|---|---|
| 0-11 km | Troposphere | Linear temp decrease |
| 11-20 km | Lower Stratosphere | Isothermal (216.65K) |
| 20-32 km | Upper Stratosphere | Linear temp increase |
| 32-84 km | Mesosphere | Exponential decay |
| >84 km | Thermosphere | Negligible density |
R_EARTH = 6,371,000 m # Earth radius
G = 6.67430×10⁻¹¹ # Gravitational constant
M_EARTH = 5.972×10²⁴ kg # Earth mass
ρ₀ = 1.225 kg/m³ # Sea-level air densityProduction: https://ballistix.onrender.com
Local: http://localhost:8000
GET /health{
"status": "ok",
"model_loaded": true,
"api_version": "1.0.0"
}POST /predict
Content-Type: application/json
{
"v0": 300,
"angle": 45,
"drag": 0.01,
"dt": 0.01,
"release_height": 0
}Response:
{
"xs": [0.0, 2.1, 4.2, ...],
"ys": [0.0, 1.5, 2.9, ...],
"impact_physics": 9174.32,
"impact_ml": 9168.45,
"max_height": 2295.68,
"max_range": 9174.32,
"flight_time": 61.24,
"trajectory_points": 6124
}GET /model/infoPOST /retrain
Content-Type: application/json
{
"n_samples": 1200,
"use_forest": true
}# Health check
curl https://ballistix.onrender.com/health
# Run prediction
curl -X POST https://ballistix.onrender.com/predict \
-H "Content-Type: application/json" \
-d '{"v0":300,"angle":45,"drag":0.01,"dt":0.01,"release_height":0}'| Parameter | Value |
|---|---|
| Algorithm | Random Forest Regressor |
| Trees | 100 estimators |
| R² Score | ~0.99 |
| Training Samples | 1,200 |
| Features | v0, angle, drag, release_height |
| Target | Impact distance |
Physics Simulation → Generate Dataset → Train/Test Split (80/20)
↓
StandardScaler
↓
Random Forest Fit
↓
Cross-Validation (5-fold)
↓
Save Model + Metadata
Pre-configured profiles with verified specifications:
| Missile | Country | Range | Speed |
|---|---|---|---|
| Minuteman III | 🇺🇸 USA | 13,000 km | Mach 23 |
| Trident II D5 | 🇺🇸 USA | 11,300 km | Mach 24 |
| RS-28 Sarmat | 🇷🇺 Russia | 18,000 km | Mach 20.7 |
| DF-41 | 🇨🇳 China | 12,000-15,000 km | Mach 25 |
| Agni-V | 🇮🇳 India | 5,500-8,000 km | Mach 24 |
| Missile | Country | Range | Platform |
|---|---|---|---|
| Trident II | 🇺🇸 USA | 11,300 km | Ohio-class |
| R-30 Bulava | 🇷🇺 Russia | 8,300 km | Borei-class |
| JL-3 | 🇨🇳 China | 10,000+ km | Type 096 |
| Missile | Country | Range | Speed |
|---|---|---|---|
| Tomahawk | 🇺🇸 USA | 2,500 km | Mach 0.75 |
| BrahMos | 🇮🇳/🇷🇺 | 450 km | Mach 2.8 |
| Kalibr | 🇷🇺 Russia | 2,500 km | Mach 0.8 |
Sources: CSIS Missile Threat, FAS, Jane's Defence
- React 18 - UI framework
- Vite 5 - Build tool
- Recharts - Data visualization
- Three.js - 3D globe
- Lucide React - Icons
- Axios - HTTP client
- Modern CSS - Glassmorphism, gradients, responsive
- FastAPI - Web framework
- Uvicorn - ASGI server
- Scikit-learn - ML models
- NumPy/SciPy - Numerical computing
- Pandas - Data processing
- SQLAlchemy - ORM
- Pydantic - Data validation
- Vercel - Frontend hosting
- Render - Backend hosting
- GitHub - Version control
- The About page features a modern landing design with animated hero, glassmorphism, and a dark theme.
- Footer navigation buttons (Home, Ballistic, Analytics, Settings) and the "Launch Simulator" CTA are fully functional, switching views using the
onNavigateprop. - Navigation view names:
trajectory,ballistic,analytics,settings.
| Metric | Value |
|---|---|
| API Response (predict) | < 100ms |
| Physics Simulation | ~100k steps/sec |
| ML Inference | < 5ms |
| Frontend Bundle | 645 KB (gzipped: 183 KB) |
| Lighthouse Score | 85+ |
- ✅ Input validation with Pydantic
- ✅ CORS configured per environment
- ✅ No sensitive data in client storage
- ✅ HTTPS enforced in production
⚠️ Rate limiting recommended for production
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see LICENSE for details.
MIT License
Copyright (c) 2025 Rohit Rana