This module defines usual units and convenient ways to convert between them. More...
Classes | |
class | RQuantity< MassDim, LengthDim, TimeDim, AngleDim, CurrentDim, LumDim, SubDim, TempDim > |
prototype template container class, that just holds a double value. More... | |
This module defines usual units and convenient ways to convert between them.
a Quantity
is defined as a double
with a Unit
attached. A unit combines the following 8 dimensions to some powers:
for example,
QUANTITY_TYPE(0, 0, -1, 0, 0, 0, 0, 0, QFrequency)
QUANTITY_TYPE(1, 2, -2, 0, 0, 0, 0, 0, QEnergy)
Below are listed the base definitions:
QUANTITY_TYPE(0, 0, 0, 0, 0, 0, 0, 0, Number)
QUANTITY_TYPE(1, 0, 0, 0, 0, 0, 0, 0, QMass)
QUANTITY_TYPE(0, 1, 0, 0, 0, 0, 0, 0, QLength)
QUANTITY_TYPE(0, 2, 0, 0, 0, 0, 0, 0, QArea)
QUANTITY_TYPE(0, 3, 0, 0, 0, 0, 0, 0, QVolume)
QUANTITY_TYPE(0, 0, 1, 0, 0, 0, 0, 0, QTime)
QUANTITY_TYPE(0, 1, -1, 0, 0, 0, 0, 0, QSpeed)
QUANTITY_TYPE(0, 1, -2, 0, 0, 0, 0, 0, QAcceleration)
QUANTITY_TYPE(0, 1, -3, 0, 0, 0, 0, 0, QJerk)
QUANTITY_TYPE(0, 0, -1, 0, 0, 0, 0, 0, QFrequency)
QUANTITY_TYPE(1, 1, -2, 0, 0, 0, 0, 0, QForce)
QUANTITY_TYPE(1, -1, -2, 0, 0, 0, 0, 0, QPressure)
QUANTITY_TYPE(0, 0, 0, 0, 1, 0, 0, 0, QCurrent)
QUANTITY_TYPE(0, 0, 0, 0, 0, 1, 0, 0, QLuminosity)
QUANTITY_TYPE(0, 0, 0, 0, 0, 0, 1, 0, QSubstance)
QUANTITY_TYPE(0, 0, 0, 0, 0, 0, 0, 1, QTemperature)
QUANTITY_TYPE(1, 2, -2, 0, 0, 0, 0, 0, QEnergy)
QUANTITY_TYPE(1, 2, -3, 0, 0, 0, 0, 0, QFlux)
QUANTITY_TYPE(1, -1, -3, 0, 0, 0, 0, 0, QSpectralFluxDensity)
QUANTITY_TYPE(0, 0, 0, 1, 0, 0, 0, 0, Angle)
QUANTITY_TYPE(0, 0, 0, 2, 0, 0, 0, 0, AngleArea)
We predefined units as constexpr
which are optimized at compilation time.