Skip to content

Commit 3771ab7

Browse files
Create README.md
1 parent f462277 commit 3771ab7

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

orbital-mechanics/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Orbital Mechanics Simulation 🌍🛰️
2+
3+
This project simulates a planet orbiting a star using Newton's Law of Universal Gravitation and basic physics.
4+
5+
You can watch the orbit evolve over time with a live animation and even see a fading trail behind the planet!
6+
7+
## 🚀 Features
8+
9+
- Realistic gravitational physics
10+
- Adjustable orbital parameters (mass, velocity, distance, etc.)
11+
- Fading orbit trail for a cool visual effect
12+
- Uses `matplotlib` for animation
13+
- Based on Earth's orbit around the Sun
14+
15+
## 📁 Files
16+
17+
- `main.py` — Main simulation script
18+
- `README.md` — You're here!
19+
20+
## 🧠 Physics Behind It
21+
22+
The force between the star and the planet is calculated using:
23+
F = G * (m1 * m2) / r²
24+
25+
Where:
26+
- `G` is the gravitational constant
27+
- `m1` and `m2` are the masses
28+
- `r` is the distance between them
29+
30+
This force updates the planet’s velocity and position using basic kinematics.
31+
32+
## 🔧 Requirements
33+
34+
You’ll need Python and these libraries:
35+
- `matplotlib`
36+
- `math`
37+
38+
Install them using:
39+
40+
```bash
41+
pip install matplotlib
42+
43+
## 🖼️ Example Output
44+
45+
<img width="640" height="480" alt="Figure_1" src="https://github.com/user-attachments/assets/03354c23-900e-4a11-9f13-b61d5f87b297" />

0 commit comments

Comments
 (0)