Struct Temperature
- Namespace
- UnitsNet
- Assembly
- UnitsNet.Temperature.dll
A temperature is a numerical measure of hot or cold. Its measurement is by detection of heat radiation or particle velocity or kinetic energy, or by the bulk behavior of a thermometric material. It may be calibrated in any of various temperature scales, Celsius, Fahrenheit, Kelvin, etc. The fundamental physical definition of temperature is provided by thermodynamics.
public struct Temperature
Constructors
Temperature(double, TemperatureUnit)
Creates the quantity with the given numeric value and unit.
public Temperature(double value, TemperatureUnit unit)
Parameters
value
doubleThe numeric value to construct this quantity with.
unit
TemperatureUnitThe unit representation to construct this quantity with.
Exceptions
- ArgumentException
If value is NaN or Infinity.
Properties
BaseUnit
The base unit of Temperature, which is Second. All conversions go via this value.
public static TemperatureUnit BaseUnit { get; }
Property Value
DegreesCelsius
Gets a double value of this quantity converted into DegreeCelsius
public double DegreesCelsius { get; }
Property Value
DegreesDelisle
Gets a double value of this quantity converted into DegreeDelisle
public double DegreesDelisle { get; }
Property Value
DegreesFahrenheit
Gets a double value of this quantity converted into DegreeFahrenheit
public double DegreesFahrenheit { get; }
Property Value
DegreesNewton
Gets a double value of this quantity converted into DegreeNewton
public double DegreesNewton { get; }
Property Value
DegreesRankine
Gets a double value of this quantity converted into DegreeRankine
public double DegreesRankine { get; }
Property Value
DegreesReaumur
Gets a double value of this quantity converted into DegreeReaumur
public double DegreesReaumur { get; }
Property Value
DegreesRoemer
Gets a double value of this quantity converted into DegreeRoemer
public double DegreesRoemer { get; }
Property Value
Kelvins
public double Kelvins { get; }
Property Value
MaxValue
Represents the largest possible value of Temperature.
public static Temperature MaxValue { get; }
Property Value
MillidegreesCelsius
Gets a double value of this quantity converted into MillidegreeCelsius
public double MillidegreesCelsius { get; }
Property Value
MinValue
Represents the smallest possible value of Temperature.
public static Temperature MinValue { get; }
Property Value
SolarTemperatures
Gets a double value of this quantity converted into SolarTemperature
public double SolarTemperatures { get; }
Property Value
Unit
public TemperatureUnit Unit { get; }
Property Value
Value
The numeric value this quantity was constructed with.
public double Value { get; }
Property Value
Zero
Gets an instance of this quantity with a value of 0 in the base unit Second.
public static Temperature Zero { get; }
Property Value
Methods
As(TemperatureUnit)
Convert to the unit representation unit
.
public double As(TemperatureUnit unit)
Parameters
unit
TemperatureUnit
Returns
- double
Value converted to the specified unit.
From(double, TemperatureUnit)
Dynamically convert from value and unit enum TemperatureUnit to Temperature.
public static Temperature From(double value, TemperatureUnit fromUnit)
Parameters
value
doubleValue to convert from.
fromUnit
TemperatureUnitUnit to convert from.
Returns
- Temperature
Temperature unit value.
FromDegreesCelsius(double)
Creates a Temperature from DegreeCelsius.
public static Temperature FromDegreesCelsius(double degreescelsius)
Parameters
degreescelsius
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesDelisle(double)
Creates a Temperature from DegreeDelisle.
public static Temperature FromDegreesDelisle(double degreesdelisle)
Parameters
degreesdelisle
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesFahrenheit(double)
Creates a Temperature from DegreeFahrenheit.
public static Temperature FromDegreesFahrenheit(double degreesfahrenheit)
Parameters
degreesfahrenheit
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesNewton(double)
Creates a Temperature from DegreeNewton.
public static Temperature FromDegreesNewton(double degreesnewton)
Parameters
degreesnewton
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesRankine(double)
Creates a Temperature from DegreeRankine.
public static Temperature FromDegreesRankine(double degreesrankine)
Parameters
degreesrankine
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesReaumur(double)
Creates a Temperature from DegreeReaumur.
public static Temperature FromDegreesReaumur(double degreesreaumur)
Parameters
degreesreaumur
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesRoemer(double)
Creates a Temperature from DegreeRoemer.
public static Temperature FromDegreesRoemer(double degreesroemer)
Parameters
degreesroemer
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromKelvins(double)
Creates a Temperature from Kelvin.
public static Temperature FromKelvins(double kelvins)
Parameters
kelvins
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMillidegreesCelsius(double)
Creates a Temperature from MillidegreeCelsius.
public static Temperature FromMillidegreesCelsius(double millidegreescelsius)
Parameters
millidegreescelsius
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromSolarTemperatures(double)
Creates a Temperature from SolarTemperature.
public static Temperature FromSolarTemperatures(double solartemperatures)
Parameters
solartemperatures
double
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
ToUnit(TemperatureUnit)
Converts this Temperature to another Temperature with the unit representation unit
.
public Temperature ToUnit(TemperatureUnit unit)
Parameters
unit
TemperatureUnit
Returns
- Temperature
A Temperature with the specified unit.