|
TinyRobotics
|
Represents a 3D speed or velocity vector with unit support. More...
#include <Velocity3D.h>
Public Member Functions | |
| Velocity3D (float x, float y, float z, VelocityUnit unit) | |
| float | getX (VelocityUnit desiredUnit) const |
| float | getY (VelocityUnit desiredUnit) const |
| float | getZ (VelocityUnit desiredUnit) const |
Public Attributes | |
| float | x = 0.0f |
| float | y = 0.0f |
| float | z = 0.0f |
| VelocityUnit | unit = VelocityUnit::MPS |
Represents a 3D speed or velocity vector with unit support.
This class encapsulates a 3D speed (or velocity) measurement, storing x, y, and z components along with a unit (meters per second, kilometers per hour, feet per second, or miles per hour). It provides methods to retrieve each component in any supported unit, handling conversion as needed.
Speed3D is useful for robotics, navigation, and simulation applications where 3D motion must be represented and manipulated in a type-safe and unit-aware manner. It is compatible with the Speed class for 1D speed and can be used interchangeably with Velocity3D.
Example usage: