|
(Note that these are not member functions.)
|
|
Helper typedef for unit conversion
|
| template<typename Unit1 , typename Unit2 > |
| using | UnitMultiply = Unit< Unit1::factorLength+Unit2::factorLength, Unit1::factorMass+Unit2::factorMass, Unit1::factorTime+Unit2::factorTime, Unit1::factorCurrent+Unit2::factorCurrent, Unit1::factorTemperature+Unit2::factorTemperature, Unit1::factorAmountOfSubstance+Unit2::factorAmountOfSubstance, Unit1::factorLuminousIntensity+Unit2::factorLuminousIntensity > |
| | The UnitMultiply type is an alias of multiply calculation with two units. More...
|
| |
| template<typename Unit1 , typename Unit2 > |
| using | UnitDivide = Unit< Unit1::factorLength - Unit2::factorLength, Unit1::factorMass - Unit2::factorMass, Unit1::factorTime - Unit2::factorTime, Unit1::factorCurrent - Unit2::factorCurrent, Unit1::factorTemperature - Unit2::factorTemperature, Unit1::factorAmountOfSubstance - Unit2::factorAmountOfSubstance, Unit1::factorLuminousIntensity - Unit2::factorLuminousIntensity > |
| | The UnitDivide type is an alias of divide calculation with two units. More...
|
| |
| template<typename U , int n> |
| using | UnitPow = Unit< U::factorLength *n, U::factorMass *n, U::factorTime *n, U::factorCurrent *n, U::factorTemperature *n, U::factorAmountOfSubstance *n, U::factorLuminousIntensity *n > |
| | The UnitPow type is an alias of power calculation with two units. More...
|
| |
| template<typename U , int n> |
| using | UnitRoot = Unit< U::factorLength/n, U::factorMass/n, U::factorTime/n, U::factorCurrent/n, U::factorTemperature/n, U::factorAmountOfSubstance/n, U::factorLuminousIntensity/n > |
| | The UnitRoot type is an alias of power calculation with two units. More...
|
| |
|
7 international base units.
|
| typedef Unit< 0, 0, 0, 0, 0, 0, 0 > | Scala |
| | The scala type of non-unit. More...
|
| |
| typedef Unit< 1, 0, 0, 0, 0, 0, 0 > | Length |
| | Length unit, called meter, with symbol m. More...
|
| |
| typedef Unit< 0, 1, 0, 0, 0, 0, 0 > | Mass |
| | Mass unit, called kilogram, with symbol kg. More...
|
| |
| typedef Unit< 0, 0, 1, 0, 0, 0, 0 > | Time |
| | Time unit, called second, with symbol s. More...
|
| |
| typedef Unit< 0, 0, 0, 1, 0, 0, 0 > | Current |
| | Electric current unit, called ampere, with symbol A. More...
|
| |
| typedef Unit< 0, 0, 0, 0, 1, 0, 0 > | Temperature |
| | Thermodynamic temperature unit, called kelvin, with symbol K. More...
|
| |
| typedef Unit< 0, 0, 0, 0, 0, 1, 0 > | AmountOfSubstance |
| | Amount of substance unit, called mole, with symbol mol. More...
|
| |
| typedef Unit< 0, 0, 0, 0, 0, 0, 1 > | LuminousIntensity |
| | Luminous intensity unit, called candela, with symbol cd. More...
|
| |
|
International System of Units derived from base units.
|
| typedef UnitDivide< Length, Time > | Speed |
| | Speed unit, derived from . More...
|
| |
| typedef UnitDivide< Speed, Time > | Acceleration |
| | Acceleration unit, derived from . More...
|
| |
| typedef UnitDivide< Scala, Time > | Frenquency |
| | Frequence unit, called hertz, with symbol Hz, derived from . More...
|
| |
| typedef UnitMultiply< Mass, Acceleration > | Force |
| | Force unit, called newton, with symbol N, derived from . More...
|
| |
| typedef UnitMultiply< Length, Length > | Area |
| | Area unit, with symbol . More...
|
| |
| typedef UnitMultiply< Area, Length > | Volume |
| | Volume unit, with symbol . More...
|
| |
| typedef UnitDivide< Force, Area > | Pressure |
| | Pressure unit, called pascal, with symbol Pa, derived from or . More...
|
| |
| typedef UnitMultiply< Force, Length > | Energy |
| | Enegy unit, called joule, with symbol J, derived from or . More...
|
| |
| typedef UnitDivide< Energy, Time > | Power |
| | Power unit, called watt, with symbol W, derived from or . More...
|
| |
| typedef UnitMultiply< Time, Current > | Charge |
| | Charge unit, called coulomb, with symbol C, derived from . More...
|
| |
| typedef UnitDivide< Power, Current > | Voltage |
| | Voltage unit, called volt, with symbol V, derived from or . More...
|
| |
| typedef UnitDivide< Charge, Voltage > | ElelctricCapacitance |
| | Elelctric capacitance unit, called farad, with symbol F, derived from or . More...
|
| |
| typedef UnitDivide< Voltage, Current > | ElectricResistance |
| | Electric resistance unit, called ohm, with symbol Ω, derived from or . More...
|
| |
| typedef UnitDivide< Scala, ElectricResistance > | ElelctricConductance |
| | Electric conductance unit, called simens, with symbol S, derived from or . More...
|
| |
| typedef UnitMultiply< Voltage, Time > | MagneticFlux |
| | Magnetic flux unit, called webber, with symbol Wb**, derived from or . More...
|
| |
| typedef UnitDivide< MagneticFlux, Area > | MagnetFluxDensity |
| | Magnet flux density unit, called tesla, with symbol T, derived from or . More...
|
| |
| typedef UnitDivide< MagneticFlux, Current > | Inductance |
| | Electric unit, called henry, with symbol H, derived from or . More...
|
| |
| typedef LuminousIntensity | Luminous |
| | Luminous flux unit, called lumen, with symbol lm, derived from . More...
|
| |
| typedef UnitDivide< LuminousIntensity, Area > | Illuminance |
| | Illuminance unit, called lux, with symbol ls, derived from or . More...
|
| |
| typedef UnitDivide< Scala, Time > | Radioactivity |
| | Radioactivity unit of decays per second, called becquerel, with symbol Bq derived from . More...
|
| |
| typedef UnitDivide< Energy, Mass > | AbsorbedDose |
| | Absorbed dose unit of ionising radiation, called gray, with symbol Gy, derived from or . More...
|
| |
| typedef UnitDivide< Energy, Mass > | EquivalentDose |
| | Equivalent dose unit of ionising radiation, called sievert, with symbol Sv, derived from or . More...
|
| |
| typedef UnitDivide< AmountOfSubstance, Time > | CatalyticActivity |
| | Catalytic activity unit called katal, with symbol kat, derived from . More...
|
| |
template<int length, int mass, int time, int current, int temperature, int amountOfSubstance, int luminousIntensity>
struct Dimensional::Unit< length, mass, time, current, temperature, amountOfSubstance, luminousIntensity >
The Unit struct is used to describe physical units.
- Template Parameters
-
| length | Power factor of length unit. |
| mass | Power factor of length mass unit. |
| time | Power factor of length time unit. |
| current | Power factor of length current unit. |
| temperature | Power factor of length temperature unit. |
| amountOfSubstance | Power factor of amount_of_substance unit. |
| luminousIntensity | Power factor of luminous_intensity unit. |
This template use 7 international base units to describe all physical units, to guarantee strong-typed unit analysis.
Directly use this struct is not suggested, use UnitMultiply, UnitDivide, UnitPower and UnitRoot with typedef/using to generate derived unit with exisiting units.
sa DimensionalAnalysis, Quantity