🌍 Bodies and 💫 Fields
This initial release introduces the basic types and functionality to simulate gravitational force between N bodies in two dimensional space. The force calculation uses a brute force approach, whereby the force between each pair of bodies is calculated individually. This is algorithm has a time complexity of O(n^2)
, but the next release will provide an O(nlogn)
solution!
New
Point
andVector
for position and velocity / force.Body
to represent a movable object in space.Field
to represent a force that acts on a group of bodies.Environment
to represent the a space containing bodies and fields.- A Foreign Function Interface (FFI) that exposes methods to construct an environment with N bodies, advance the state of the environment, and query the positions of the bodies.
Attachments
- Crate file
- Binary targeting iOS architectures