Table of Contents

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 double

The numeric value to construct this quantity with.

unit TemperatureUnit

The 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

TemperatureUnit

DegreesCelsius

Gets a double value of this quantity converted into DegreeCelsius

public double DegreesCelsius { get; }

Property Value

double

DegreesDelisle

Gets a double value of this quantity converted into DegreeDelisle

public double DegreesDelisle { get; }

Property Value

double

DegreesFahrenheit

Gets a double value of this quantity converted into DegreeFahrenheit

public double DegreesFahrenheit { get; }

Property Value

double

DegreesNewton

Gets a double value of this quantity converted into DegreeNewton

public double DegreesNewton { get; }

Property Value

double

DegreesRankine

Gets a double value of this quantity converted into DegreeRankine

public double DegreesRankine { get; }

Property Value

double

DegreesReaumur

Gets a double value of this quantity converted into DegreeReaumur

public double DegreesReaumur { get; }

Property Value

double

DegreesRoemer

Gets a double value of this quantity converted into DegreeRoemer

public double DegreesRoemer { get; }

Property Value

double

Kelvins

Gets a double value of this quantity converted into Kelvin

public double Kelvins { get; }

Property Value

double

MaxValue

Represents the largest possible value of Temperature.

public static Temperature MaxValue { get; }

Property Value

Temperature

MillidegreesCelsius

Gets a double value of this quantity converted into MillidegreeCelsius

public double MillidegreesCelsius { get; }

Property Value

double

MinValue

Represents the smallest possible value of Temperature.

public static Temperature MinValue { get; }

Property Value

Temperature

SolarTemperatures

Gets a double value of this quantity converted into SolarTemperature

public double SolarTemperatures { get; }

Property Value

double

Unit

public TemperatureUnit Unit { get; }

Property Value

TemperatureUnit

Value

The numeric value this quantity was constructed with.

public double Value { get; }

Property Value

double

Zero

Gets an instance of this quantity with a value of 0 in the base unit Second.

public static Temperature Zero { get; }

Property Value

Temperature

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 double

Value to convert from.

fromUnit TemperatureUnit

Unit 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

Temperature

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

Temperature

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

Temperature

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

Temperature

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

Temperature

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

Temperature

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

Temperature

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

Temperature

Exceptions

ArgumentException

If value is NaN or Infinity.

FromMillidegreesCelsius(double)

public static Temperature FromMillidegreesCelsius(double millidegreescelsius)

Parameters

millidegreescelsius double

Returns

Temperature

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

Temperature

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.