Skip to content
Marcus Ackre Medina edited this page Jul 20, 2026 · 2 revisions

MarcusMedina.Units.Temperature

Fluent temperature unit conversion for .NET 10+ — metric, US customary, and historical scales, all built on a single strongly-typed Temperature struct.

dotnet add package MarcusMedina.Units.Temperature

Why this exists

This one, like several of its siblings, came from watching students struggle through their exercises. Temperature conversions look simple until you're the one trying to explain why Fahrenheit needs that strange 459.67 offset, or why Réaumur splits the freezing-to-boiling range into 80 degrees instead of 100. Coding each scale out properly was how I made sure I actually understood what I was about to explain, rather than just repeating a formula from the textbook. I wanted each unit conversion broken into the same small, obvious steps I'd walk a student through by hand, not buried inside a single formula.

Who this is for

  • New to C#? A clean example of a fluent conversion API, including a deliberate case where an operator (+ on two absolute temperatures) is marked [Obsolete] because it's physically meaningless — worth reading if you want to see how a library can guide correct usage.
  • Need real conversions? Every scale is backed by an explicit, documented formula against Kelvin — no guessing which raw double means what.

Pages

Quick Example

using MarcusMedina.Units.Temperature.Metric;
using MarcusMedina.Units.Temperature.Historical;

Temperature boiling  = 100.DegreesCelsius();
Temperature oldScale = 80.DegreesReaumur();

double fahrenheit = boiling.ToFahrenheit();  // 212
double celsius    = oldScale.ToCelsius();    // 100

Temperature warmer = boiling - 10.DegreesCelsius();
bool hotter = boiling > oldScale;

Links

Clone this wiki locally