Skip to content

Minimal implementation for planetary system (n-body problem) with pygame and numpy

License

Notifications You must be signed in to change notification settings

jbaumg93/planets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

planets

Minimal implementation for planetary system (n-body problem) with pygame and numpy. It prints the FPS and the sum of mass*velocity once per second in your terminal. To stop drifting of the planets, an additional planet is added with a velocity vector which is the opposite of the sum of all (randomly generated) planets' velocity vectors.

For more details, see my blog post.

planets demo

Setup

Create env and install requirements:

virtualenv -p python3 env
source env/bin/activate
pip install -r requirements.txt

Run it:

python planets.py

About

Minimal implementation for planetary system (n-body problem) with pygame and numpy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages