Skip to content

About

Simulating two and three bodies with gravitational force between them.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

two-body-problem using pygame library

Simulating two bodies with gravitational force between them.
You can change the values of the Parameters to see the changes in the bodies' trajectories and other changes.
Note that always use float dataType for the values of Parameters. Ex: If you want to set vx1 = 20, then write it as vx1 = 20.0
Each pixel corresponds to 1m*1m dimension.

Spaceship Controls

The orbiting object in spaceship.py is our spaceship. We can control its thrust, try pressing W,S,A,D.
Thrust value can be changed by UP and DOWN Keys
The front of the spaceship is always in the direction of its motion. To give a thrust from behind press W, from front S and A for left, D for right.
One can give thrust in any direction by pressing SPACE, note that the direction of this thrust will be in the direction away from your mouse cursor on the screen.

About

Simulating two and three bodies with gravitational force between them.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages