Unit
Unit of measurement that defines a quantity, such as grams, meters, or seconds.
This is the base class for units. Actual units (such as Units.Grams and ) can be found in the Units class.
Since
1.0.0-pre
Parameters
Inheritors
Constructors
Creates a new unit with the given name and multiplier to the base unit.
Properties
Gets the conversion function used to convert values to terms of this unit. This generally shouldn't need to be used directly; prefer fromBaseUnits instead.
Gets the conversion function used to convert values to base unit terms. This generally shouldn't need to be used directly; prefer toBaseUnits instead.
Functions
Converts a magnitude in terms of another unit of the same dimension to a magnitude in terms of this unit.
Checks if this unit is equivalent to another one. Equivalence is determined by both units having the same base type and treat the same base unit magnitude as the same magnitude in their own units, to within Measure.EQUIVALENCE_THRESHOLD.
Converts a value in terms of base units to a value in terms of this unit.
Checks if this unit is the base unit for its own system of measurement.
Creates a new measure with a magnitude equal to the given base unit magnitude, converted to be in terms of this unit.
Takes this unit and creates a new proportional unit where this unit is the numerator and the given denominator is the denominator.
Creates a velocity unit derived from this one. Can be chained to denote velocity, acceleration, jerk, etc.
Converts a value in terms of this unit to a value in terms of the base unit.