Library for determining acceleration, velocity, speed, and arc length.
This mathematic functionality is intended to be decoupled from any hardware implementation details. Drivers for initialization and retrieving values from the accelerometer are independent of this. For testing the math functions, a dummy driver (will be made) available.
This library gives helper functions for preforming Euler's Method in 3D space.
For calculating arc length (the distance traveled), the formula referenced is
where
Because of the nature of accelerometers, acceleration is actually the initial measurement everything else is calculated from. Thus, a more accurate representation of the calculations done internally may be
where
Some calculations are better done with a change of coordinates, such the current incline on a hill. Spherical coordinates are a generalization of polar coordinates that allow this library to more easily work with angles. The covention for Spherical coordinates used is the ISO standard or "physics convention" as seen here:
The following equations describe a change of coordinates from cartesian to spherical:
The following equations describe a change of coordinates from spherical to cartesian: