Join the Discord channel for live tech support!
pygravity is a library used for calculating gravity in Python.
Either install from source: (Note that you will need a C compiler installed)
$ git clone https://github.com/gaming32/pygravity
$ cd pygravity
$ python setup.py install
Or install from pip:
$ python -m pip install python-gravity
API documentation can be found at https://gaming32.github.io/pygravity/. Following is some short documentation.
Pygravity is made up of a math module (pygravity.math
) for generic gravity-related math, and a subpackage (pygravity.twod
) for doing 2D calculations.
For in-depth documentation please install the package and use pydoc
(python -m pydoc -b
).
This package has three lower-level modules for doing gravity math: pygravity.twod.vector
, pygravity.twod.physics
, and pygravity.twod.gravity
.
It also provides two higher-level modules for doing simple math: pygravity.twod.util
and pygravity.twod.pygame_simulation
.
Most of pygravity.twod.pygame_simulation
should be considered in beta and should not be used without examining it's code first.