Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Orbital Mechanics Simulation 🌍🛰️

This project simulates a planet orbiting a star using Newton's Law of Universal Gravitation and basic physics.

You can watch the orbit evolve over time with a live animation and even see a fading trail behind the planet!

🚀 Features

  • Realistic gravitational physics
  • Adjustable orbital parameters (mass, velocity, distance, etc.)
  • Fading orbit trail for a cool visual effect
  • Uses matplotlib for animation
  • Based on Earth's orbit around the Sun

📁 Files

  • main.py — Main simulation script
  • README.md — You're here!

🧠 Physics Behind It

The force between the star and the planet is calculated using: F = G * (m1 * m2) / r²

Where:

  • G is the gravitational constant
  • m1 and m2 are the masses
  • r is the distance between them

This force updates the planet’s velocity and position using basic kinematics.

🔧 Requirements

You’ll need Python and these libraries:

  • matplotlib
  • math

Install them using:

pip install matplotlib

🖼️ Example Output

Figure_1