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
valuedoubleThe numeric value to construct this quantity with.
unitTemperatureUnitThe 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
unitTemperatureUnit
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
valuedoubleValue to convert from.
fromUnitTemperatureUnitUnit to convert from.
Returns
- Temperature
Temperature unit value.
FromDegreesCelsius(double)
Creates a Temperature from DegreeCelsius.
public static Temperature FromDegreesCelsius(double degreescelsius)
Parameters
degreescelsiusdouble
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesDelisle(double)
Creates a Temperature from DegreeDelisle.
public static Temperature FromDegreesDelisle(double degreesdelisle)
Parameters
degreesdelisledouble
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesFahrenheit(double)
Creates a Temperature from DegreeFahrenheit.
public static Temperature FromDegreesFahrenheit(double degreesfahrenheit)
Parameters
degreesfahrenheitdouble
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesNewton(double)
Creates a Temperature from DegreeNewton.
public static Temperature FromDegreesNewton(double degreesnewton)
Parameters
degreesnewtondouble
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesRankine(double)
Creates a Temperature from DegreeRankine.
public static Temperature FromDegreesRankine(double degreesrankine)
Parameters
degreesrankinedouble
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesReaumur(double)
Creates a Temperature from DegreeReaumur.
public static Temperature FromDegreesReaumur(double degreesreaumur)
Parameters
degreesreaumurdouble
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromDegreesRoemer(double)
Creates a Temperature from DegreeRoemer.
public static Temperature FromDegreesRoemer(double degreesroemer)
Parameters
degreesroemerdouble
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromKelvins(double)
Creates a Temperature from Kelvin.
public static Temperature FromKelvins(double kelvins)
Parameters
kelvinsdouble
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromMillidegreesCelsius(double)
Creates a Temperature from MillidegreeCelsius.
public static Temperature FromMillidegreesCelsius(double millidegreescelsius)
Parameters
millidegreescelsiusdouble
Returns
Exceptions
- ArgumentException
If value is NaN or Infinity.
FromSolarTemperatures(double)
Creates a Temperature from SolarTemperature.
public static Temperature FromSolarTemperatures(double solartemperatures)
Parameters
solartemperaturesdouble
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
unitTemperatureUnit
Returns
- Temperature
A Temperature with the specified unit.