Skip to content

Latest commit

 

History

History
11 lines (10 loc) · 898 Bytes

README.md

File metadata and controls

11 lines (10 loc) · 898 Bytes

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.