Math Module
The Math module provides essential types for 2D physics calculations in Box2D. It includes vectors, transformations, rotations, matrices, and bounding boxes that form the foundation of the physics engine.
Key design principles of the Math module:
Immutable objects: Operations return new instances rather than modifying existing ones
Pythonic interfaces: Classes support Python operators, iteration protocols and unpacking
Robust calculations: Handles edge cases safely with proper numerical handling
Box2D integration: All classes provide conversion to and from Box2D’s native C++ types