dimension
namespace nin::inline units {
struct dimension;
}
Represents the physical dimension of a quantity as a tuple of seven integer exponents, one for each SI base quantity.
Data members
α
β
γ
δ
ε
ζ
η
SI base dimension exponents
α
β
γ
δ
ε
ζ
η
SI base dimension exponents
|
Time (second) |
|
Length (metre) |
|
Mass (kilogram) |
|
Electric current (ampere) |
|
Temperature (kelvin) |
|
Amount of substance (mole) |
|
Luminous intensity (candela) |
All default-initialized to 0 (dimensionless).
Member functions
operator ==
equality comparison
operator ==
equality comparison
|
(1) |
Returns true if all seven exponents are equal. Defaulted.
operator *=
operator /=
dimension arithmetic assignment
operator *=
operator /=
dimension arithmetic assignment
|
(1) |
|
(2) |
-
(1) Adds the exponents of
rhsto*this(dimension multiplication). -
(2) Subtracts the exponents of
rhsfrom*this(dimension division).
sqrt
square root of a dimension
sqrt
square root of a dimension
|
(1) |
Returns a dimension with all exponents halved.
Throws std::domain_error if any exponent is odd.
is_sqrt_ok
check if square root is valid
is_sqrt_ok
check if square root is valid
|
(1) |
Returns true if all exponents are even.