Skip to content

Simple Python implementation of gravity simulation for PocketCosmos App aka PlanetAppV2

Notifications You must be signed in to change notification settings

gandie/pyGravity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyGravity

Some experimental gravity engines using Newton's formula to calculate forces between bodies.

The intention of this code is NOT to use it in prduction as python is not knwon for doing such calculation in a fast manner. It was rather written to understand the underlying algorithms and to have a working sketch for transposing into a more performant language, namely C.

Currently implemented:

More links!

Installation

Requirements and module itself:

pip install -r requirements.txt
python setup.py install

CyGravity

Cythonzied versions of PyGravity engine(s). Runs much faster due to static typing and less calls into python. Still not really production capable but rather easy to write.

Pygame visuals

Simple visualization using pygame for Barnes-Hut, run after installation:

pygravity

...or much faster...

cygravity
  • LEFT CLICK more bodies
  • RIGHT CLICK show Barnes-Hut tree

About

Simple Python implementation of gravity simulation for PocketCosmos App aka PlanetAppV2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages