Skip to content

umutonuryasar/Solar-System-Simulation-with-4-Planets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Solar System Simulation with 4 Planets

This project is a simulation of our solar system with 4 planets - Earth, Mars, Mercury, and Venus. It was created using Pygame, a Python library for game development. The simulation takes into account the gravitational forces between the planets and the sun, and animates their orbits over time.

Application Output GIF

Requirements

  • Pygame

Running the simulation

  • Clone this repository to your local machine.
  • Open your terminal/command prompt and navigate to the project directory.
  • Type python main.py to run the simulation.

How it works

The code uses Pygame to create a screen with a yellow sun in the center, and the planets are animated in their orbits around the sun. The orbits are calculated based on the gravitational forces between the sun and the planets, which are determined by the masses of the celestial bodies and the distance between them. The animation takes into account time steps (1 day in this case), and the positions of the planets are updated at each step.

Features

  • Visual representation of 4 planets in our solar system - Earth, Mars, Mercury, and Venus.
  • Orbits of the planets around the sun, calculated based on gravitational forces.
  • Distance between each planet and the sun is displayed.

Limitations

  • The simulation is limited to 4 planets and the sun.
  • The gravitational forces between the planets are not considered, only the forces between each planet and the sun.
  • The scale of the simulation is not to scale, as the distances between the celestial bodies are exaggerated for visibility purposes.

About

Solar System simulation with Pygame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages