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.3448.0 (4.8.3448.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 methodAbs Get the absolute value of this quantity.
Public methodStatic memberAbs(DimensionfulQuantity) 
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)Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Public methodEquals(DimensionfulQuantity)Indicates whether the current object is equal to another object of the same type.
Public methodEquals(Object)Indicates whether this instance and a specified object are equal.
(Overrides ValueTypeEquals(Object))
Public methodGetHashCodeReturns the hash code for this instance.
(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 methodToStringReturns the fully qualified type name of this instance.
(Overrides ValueTypeToString)
Public methodToString(String, IFormatProvider)Formats the value of the current instance using the specified format.
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) Determines whether two quantities are equal in all components.
Public operatorStatic memberGreaterThan(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberGreaterThanOrEqual(DimensionfulQuantity, DimensionfulQuantity) 
Public operatorStatic memberInequality(DimensionfulQuantity, DimensionfulQuantity) Determines whether two quantities are not equal in any component.
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
Extension Methods
 NameDescription
Public Extension MethodCheckUnitCompatibleWith Checks whether the quantity x has the expected expectedUnit, and if not, throws an ArgumentException.
(Defined by DimensionfulQuantityExtensions)
Top
See Also