Skip to content

API Overview

Marcus Ackre Medina edited this page Sep 13, 2026 · 1 revision

API Reference

All conversions are relative to the Temperature struct's base unit, Kelvin (Temperature.Kelvin). Every scale below has a matching pair of extension methods: a creation method (int/double → Temperature) and a conversion method (Temperature → double).

Temperature struct

Member Description
Temperature.Kelvin The stored value, always in Kelvin
+ Obsolete. Adding two absolute temperatures is physically meaningless; use .Kelvin directly if you really need this.
- Subtract two Temperature values (a difference)
*, / (with double) Scale a Temperature value
/ (with Temperature) Ratio between two Temperature values (returns double)
<, >, <=, >=, ==, != Full comparison support

MarcusMedina.Units.Temperature.Metric — MetricTemperatureExtensions

Scale Creation Conversion Formula
Celsius DegreesCelsius() ToCelsius() K = °C + 273.15
Kelvin Kelvin() ToKelvin() base unit

MarcusMedina.Units.Temperature.US — USTemperatureExtensions

Scale Creation Conversion Formula
Fahrenheit DegreesFahrenheit() ToFahrenheit() K = (°F + 459.67) × 5/9
Rankine DegreesRankine() ToRankine() K = °R × 5/9

MarcusMedina.Units.Temperature.Historical — HistoricalTemperatureExtensions

Scale Creation Conversion Formula
Réaumur DegreesReaumur() ToReaumur() K = °Ré × 5/4 + 273.15
Delisle DegreesDelisle() ToDelisle() K = 373.15 - °De × 2/3 (inverted: 0°De = 100°C)
Newton DegreesNewton() ToNewton() K = °N × 100/33 + 273.15
Rømer DegreesRomer() ToRomer() K = (°Rø - 7.5) × 40/21 + 273.15

Creation methods are available on both int and double throughout.