Module dimensioned::conversion
source · [−]Expand description
Conversion between unit systems
Wherever it makes sense, we implement conversion between the unit systems that ship with
dimensioned using core::convert::From
.
Note that it does not always make sense to do so. For example, while one can convert from a
subset of the SI
system to CGS
, it makes no sense to convert from CGS
to SI
.
If are interested in implementing conversion for your own unit system, here is an example demonstrating how to do so.
Conversions between unit systems are implemented as follows:
-
SI
toUCUM
: AsUCUM
does not have a unit for amount of substance, this is defined only forSI
units that don’t containMole
s. In addition, asUCUM
defines radians as a unit, it is not correct to perform this conversion if the quantity expresses an angle. -
SI
toCGS
andMKS
: These conversions are only defined forSI
units that are a combination ofMeter
,Kilogram
,Second
, andAmpere
. -
UCUM
toSI
: AsSI
does not have a unit for angle, this is only defined forUCUM
units that don’t containRadian
s. -
CGS
toMKS
-
MKS
toCGS