This package provides 2D vector and rectangle classes. These classes were written to be used in games, so they have some methods that conveniently tie into pyglet and pygame , but for the most part they are quite general and could be used for almost anything.
The vecrec module is pure-python, dependency-free, and available from PyPI:
$ pip install vecrec Basic Usage Here are a few examples showing how to construct and use the Vector and Rect classes provided by this package: