This unit refers to a reference quantity. Since the reference quantity can be changed, instances of this class are not immutable. Example: 'percent of page width': here the page width can change depending on the user defined settings.
Constructor | Description |
Full Usage:
ChangeableRelativeUnit(name, shortcut, divider, referenceQuantity)
Parameters:
string
-
The full name of the unit (e.g. 'percent of page with').
shortcut : string
-
The shortcut of the unit (e.g. %PW).
divider : float
-
Used to calculate the relative value from the numeric value of the quantity. In the above example (percent of page width), the divider is 100.
referenceQuantity : DimensionfulQuantity
-
The reference quantity.
|
|
Instance member | Description |
Full Usage:
this.FromSIUnit
Parameters:
float
-
Value in SI units.
Returns: float
The corresponding value in this unit.
Modifiers: abstract |
Converts x (in SI units) to the corresponding value in this unit.
|
Full Usage:
this.GetRelativeValueFromValue
Parameters:
float
-
Numerical value to convert.
Returns: float
The prefactor to multiply the ChangeableRelativeUnit.ReferenceQuantity with in order to get the absolute quantity.
Modifiers: abstract |
Calculated the dimensionless prefactor to multiply the ChangeableRelativeUnit.ReferenceQuantity with. Example: Given that the relative unit is 'percent of page with', a value of x=5 is converted to 0.05. The result can then be used to calculate the absolute quantity by multiplying the result of 0.05 with the 'page with'.
|
Full Usage:
this.Name
Returns: string
Modifiers: abstract |
Full name of the unit.
|
|
Returns a list of possible prefixes for this unit (like ยต, m, k, M, G..).
|
Full Usage:
this.ReferenceQuantity
Modifiers: abstract |
The corresponding quantity that this unit encapsulates. |
|
Returns the corresponding SI unit.
|
Full Usage:
this.ShortCut
Returns: string
Modifiers: abstract |
Usual shortcut of the unit.
|
Full Usage:
this.ToSIUnit
Parameters:
float
-
Value to convert.
Returns: float
The corresponding value of x in SI units.
Modifiers: abstract |
Converts x to the corresponding SI unit.
|