Click or drag to resize

DimensionfulQuantity Structure

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 AsValueInSIUnits values.
Inheritance Hierarchy
SystemObject
  SystemValueType
    Altaxo.UnitsDimensionfulQuantity

Namespace: Altaxo.Units
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public struct DimensionfulQuantity : IComparable, 
	IComparable<DimensionfulQuantity>, IEquatable<DimensionfulQuantity>, IFormattable

The DimensionfulQuantity type exposes the following members.

Constructors
 NameDescription
Public methodDimensionfulQuantity(Double)Creates a dimensionless quantity with the provided value.
Public methodDimensionfulQuantity(Double, IPrefixedUnit)Creates a quantity with the provided value in the given prefixed unit.
Public methodDimensionfulQuantity(Double, IUnit)Creates a quantity with the provided value in the given unit.
Public methodDimensionfulQuantity(Double, SIPrefix, IUnit)Creates a quantity with the provided value in the given prefixed unit.
Top
Properties
 NameDescription
Public propertyAsQuantityInSIUnitsGets this quantity in SI units (without prefix).
Public propertyAsValueInSIUnitsConverts this quantity to its numerical value in SI units (without prefix).
Public propertyStatic memberEmptyGets an empty, i.e. uninitialized, quantity.
Public propertyHasBiasedUnit Gets a value indicating whether this instance has a biased unit (i.e. a unit implementing IBiasedUnit.
Public propertyIsEmptyGets a value indicating whether this instance is empty. It is empty if no unit has been associated so far with this instance.
Public propertyPrefixGets the SI prefix of this quantity.
Public propertyPrefixedUnit Gets the prefixed unit of this quantity.
Public propertyTreatedAsUnbiasedDifference 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.
Public propertyUnitGets the unit of this quantity.
Public propertyValueGets the numeric value of this quantity in the context of prefix and unit.
Top
Methods
 NameDescription
Public methodStatic memberAbs 
Public methodAsQuantityIn(IPrefixedUnit)Converts this quantity to another quantity in the provided prefixed unit.
Public methodAsQuantityIn(IUnit)Converts this quantity to another quantity in the provided unit (without prefix).
Public methodAsQuantityIn(SIPrefix, IUnit)Converts this quantity to another quantity in the provided unit, with the provided prefix.
Public methodAsValueIn(IPrefixedUnit)Converts this quantity to its numerical value in the given unit, with the given prefix.
Public methodAsValueIn(IUnit)Converts this quantity to its numerical value in the given unit (without prefix).
Public methodAsValueIn(SIPrefix, IUnit)Converts this quantity to its numerical value in the given unit, with the given prefix.
Public methodCompareTo(DimensionfulQuantity)Compares this quanitity to another quantity.
Public methodCompareTo(Object) 
Public methodEquals(DimensionfulQuantity) 
Public methodEquals(Object)
(Overrides ValueTypeEquals(Object))
Public methodGetHashCode
(Overrides ValueTypeGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIsEqualInValuePrefixUnitDetermines 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.
Public methodStatic memberMax 
Public methodStatic memberMin 
Public methodStatic memberRoundUpOrDown 
Public methodToString
(Overrides ValueTypeToString)
Public methodToString(String, IFormatProvider) 
Public methodWithNewValue Creates an instance with a new value, and with the same prefix and unit as this quantity.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberDivision(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberDivision(DimensionfulQuantity, Double) 
Public operatorStatic memberDivision(Double, DimensionfulQuantity) 
Public operatorStatic memberEquality(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberGreaterThan(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberGreaterThanOrEqual(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberInequality(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberLessThan(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberLessThanOrEqual(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberMultiply(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberMultiply(DimensionfulQuantity, Double) 
Public operatorStatic memberMultiply(Double, DimensionfulQuantity) 
Public operatorStatic memberSubtraction(DimensionfulQuantity, DimensionfulQuantity) 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.
Public operatorStatic memberUnaryNegation(DimensionfulQuantity) 
Top
See Also