Class OffsetUnit
Offset unit.
public record OffsetUnit : Unit, IEquatable<Unit>, IEquatable<OffsetUnit>
- Inheritance
-
OffsetUnit
- Implements
- Inherited Members
Remarks
Scale and Offset define the mapping to the coherent SI unit of the dimension. Given the value in the current unit x, the scale k, and the offset b, the value in the coherent unit y = k * x + b.Constructors
OffsetUnit(Dimension, double, double)
Offset unit.
public OffsetUnit(Dimension Dimension, double Scale = 1, double Offset = 0)
Parameters
Remarks
Scale and Offset define the mapping to the coherent SI unit of the dimension. Given the value in the current unit x, the scale k, and the offset b, the value in the coherent unit y = k * x + b.Properties
Offset
The offset.
public double Offset { get; init; }
Property Value
Methods
FromCoherent(double)
Converts the specified value in the coherent unit to a value in the current unit.
public override double FromCoherent(double value)
Parameters
valuedouble- The value in the coherent unit.
Returns
- double
- A value in the current unit.
ToCoherent(double)
Converts the specified value in the current unit to a value in the corresponding coherent unit.
public override double ToCoherent(double value)
Parameters
valuedouble- The value in the current unit.
Returns
- double
- A value in the corresponding coherent unit.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
- A string that represents the current object.