Represents a quantity, consisting of a numeric value, the corresponding unit and, optionally, a SI prefix for the unit. Please note that two DimensionfulQuantity instances are considered equal only if (i) the units are equal, (ii) the prefixes are equal, and (iii) the values are equal. If you want to compare the SI values, please compare the DimensionfulQuantity.AsValueInSIUnits values.
Constructor | Description |
Full Usage:
DimensionfulQuantity(value)
Parameters:
float
-
Value.
|
Creates a dimensionless quantity with the provided value.
|
Full Usage:
DimensionfulQuantity(value, unit)
Parameters:
float
-
The value of the created quantity.
unit : IUnit
-
The unit of the created quantity.
|
Creates a quantity with the provided value in the given unit.
|
|
Creates a quantity with the provided value in the given prefixed unit. |
Full Usage:
DimensionfulQuantity(value, prefixedUnit)
Parameters:
float
-
The value of the created quantity.
prefixedUnit : IPrefixedUnit
-
The prefixed unit of the created quanity.
|
Creates a quantity with the provided value in the given prefixed unit.
|
Instance member | Description |
Full Usage:
this.AsQuantityIn
Parameters:
IUnit
-
The unit to convert the quantity to.
Returns: DimensionfulQuantity
New instance of a quantity in the provided unit (without prefix).
|
Converts this quantity to another quantity in the provided unit (without prefix).
|
Full Usage:
this.AsQuantityIn
Parameters:
SIPrefix
-
The prefix of the unit to convert the quantity to.
unit : IUnit
-
The unit to convert the quantity to.
Returns: DimensionfulQuantity
New instance of a quantity in the provided unit with the provided prefix.
|
Converts this quantity to another quantity in the provided unit, with the provided prefix.
|
Full Usage:
this.AsQuantityIn
Parameters:
IPrefixedUnit
-
The prefixed unit to convert the quantity to.
Returns: DimensionfulQuantity
New instance of a quantity in the provided prefixed unit.
|
Converts this quantity to another quantity in the provided prefixed unit.
|
|
Gets this quantity in SI units (without prefix).
|
Full Usage:
this.AsValueIn
Parameters:
IUnit
-
The unit in which to get the numerical value of this quantity.
Returns: float
Numerical value of this quantity in the provided unit (without prefix).
|
Converts this quantity to its numerical value in the given unit (without prefix).
|
Full Usage:
this.AsValueIn
Parameters:
SIPrefix
-
The prefix of the unit in which to get the numerical value of this quantity.
unit : IUnit
-
The unit in which to get the numerical value of this quantity.
Returns: float
Numerical value of this quantity in the provided unit with the provided prefix.
|
Converts this quantity to its numerical value in the given unit, with the given prefix.
|
Full Usage:
this.AsValueIn
Parameters:
IPrefixedUnit
-
The prefixed unit in which to get the numerical value of this quantity.
Returns: float
Numerical value of this quantity in the provided unit with the provided prefix.
|
Converts this quantity to its numerical value in the given unit, with the given prefix.
|
Full Usage:
this.AsValueInSIUnits
Returns: float
|
Converts this quantity to its numerical value in SI units (without prefix).
|
Full Usage:
this.CompareTo
Parameters:
DimensionfulQuantity
-
The other quantity to compare with.
Returns: int
The value is 1, if this quantity is greater than the other quantity; 0 if both quantities are equal, and -1 if this quantity is less than the other quantity.
Modifiers: abstract |
Compares this quanitity to another quantity.
|
Full Usage:
this.Equals
Parameters:
obj
Returns: bool
Modifiers: abstract |
|
Full Usage:
this.GetHashCode
Returns: int
Modifiers: abstract |
|
Full Usage:
this.HasBiasedUnit
Returns: bool
|
Gets a value indicating whether this instance has a biased unit (i.e. a unit implementing IBiasedUnit.
|
Full Usage:
this.IsEmpty
Returns: bool
|
Gets a value indicating whether this instance is empty. It is empty if no unit has been associated so far with this instance.
|
Full Usage:
this.IsEqualInValuePrefixUnit
Parameters:
DimensionfulQuantity
-
Quantity to compare.
Returns: bool
Returns true if a is equal in all three components(value, prefix, unit) to this quantity; otherwise, false .
|
Determines whether this instance is equal to another quanity in all three components (value, prefix and unit). This is not a comparison for the physical equality of the quantities.
|
|
Gets the SI prefix of this quantity.
|
|
Gets the prefixed unit of this quantity.
|
Full Usage:
this.ToString
Returns: string
Modifiers: abstract |
|
Full Usage:
this.ToString
Parameters:
string
formatProvider : IFormatProvider
Returns: string
Modifiers: abstract |
|
|
Gets the quantity as treated as unbiased difference value. If the unit of this quantity is not biased, the return value is exactly this quantity. But if the unit is biased, the return value is the difference of this quantity and the same quantity with zero value. Example: 20 °C will transform to 20 K, because 20°C - 0 °C = 20 K.
|
Gets the unit of this quantity.
|
|
Full Usage:
this.Value
Returns: float
|
Gets the numeric value of this quantity in the context of prefix and unit.
|
Full Usage:
this.WithNewValue
Parameters:
float
-
New numeric value.
Returns: DimensionfulQuantity
A new quantity with the provided value and the same prefix and unit as this quantity.
|
Creates an instance with a new value, and with the same prefix and unit as this quantity.
|
Static member | Description | ||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
Full Usage:
a - b
Parameters:
DimensionfulQuantity
-
a.
b : DimensionfulQuantity
-
The b.
Returns: DimensionfulQuantity
The result of the operator.
|
Implements the subtraction operator. Here, the intended operation is ambiguous if we subtract a biased unit and an unbiased unit. The result can be treated either as biased or unbiased. For example: 20°C minus 20 Kelvin. The result is either 293.15 K - 20 K = 273.15 K or 20°C - 20 K = 0 °C (biased). Although the same, this results in difficulties if subsequently rates are calculated from this result. Because of that, the decision was made to treat the result as unbiased value.
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
Gets an empty, i.e. uninitialized, quantity.
|
||||
|
|
||||
|
|
||||
|
|