|
RIT VEXU Core API
|
#include <units.h>
Public Member Functions | |
| constexpr | Quantity () |
| constexpr | Quantity (double value) |
| constexpr | Quantity (double value) |
| constexpr | Quantity (double value, Self unit) |
| constexpr | operator double () const |
| constexpr | Quantity (const Self &other)=default |
| constexpr double | internal () const |
| constexpr double | to (Self unit) const |
| constexpr Self & | operator+= (Self other) |
| constexpr Self & | operator+= (double other) |
| constexpr Self & | operator-= (Self other) |
| constexpr Self & | operator-= (double other) |
| constexpr Self & | operator*= (double scalar) |
| constexpr Self & | operator/= (double divisor) |
| constexpr Self & | operator= (const double &rhs) |
This class provides a physical unit conversion and dimensional analysis API. Quantities define a unit given the SI base dimensions. The dimensions are the exponents of each base, Mass, Length, Time, Current, Angle, Temperature, Luminosity, Moles. E.g. Velocity is length^1 * time^-1, length/time... Arithmetic and math functions can be used on Quantities like normal. Mass * Mass = Area.
|
inlineexplicitconstexpr |
Default to value of 0.
|
inlineexplicitconstexpr |
Construct a new Quantity object using the SI base unit
| value | to initialize with |
|
inlineconstexpr |
Construct a new Quantity object
| value | to initialize with |
|
inlineconstexpr |
Construct a quantity from a numeric value expressed in a specific unit.
| value | numeric value in the provided unit |
| unit | unit in which value is expressed |
|
constexprdefault |
Constructor copying from a quantity with the same dimensions
| other | the quantity to copy |
|
inlineconstexpr |
Gets the internal raw value
|
inlineconstexpr |
Double cast overload, gets internal value.
|
inlineconstexpr |
Multiplies this quantity by a scalar
|
inlineconstexpr |
Adds a double to this internal value Only allowed if this quantity is dimensionless
|
inlineconstexpr |
Adds another quantity's value to this.
|
inlineconstexpr |
Subtracts a double from this internal value Only allowed if this quantity is dimensionless
|
inlineconstexpr |
Subtracts another quantity's value from this.
|
inlineconstexpr |
Divides this quantity by a scalar
|
inlineconstexpr |
Sets this quantity's value to another value Only allowed if the quantity is dimensionless
|
inlineconstexpr |
Gets this quantity's numeric value expressed in a specific unit. e.g. double v_mps = v.to(mps);