aboutsummaryrefslogtreecommitdiffstats
path: root/unit.h
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-03-01 15:11:35 -0500
committerSam Anthony <sam@samanthony.xyz>2025-03-01 15:11:35 -0500
commit0d05cb75ee3c3d85481fe87ea287c97a439fe47a (patch)
tree8603e4ac9d3a58715690643862d27ed769347b8d /unit.h
parent47874c2ec00339314e43d282ab2bc906e9c9ac9b (diff)
downloadvolute-0d05cb75ee3c3d85481fe87ea287c97a439fe47a.zip
temperature conversion functions
Diffstat (limited to 'unit.h')
-rw-r--r--unit.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/unit.h b/unit.h
index 5febcd1..4e22a35 100644
--- a/unit.h
+++ b/unit.h
@@ -34,6 +34,20 @@ double as_bar(Pressure x);
double as_psi(Pressure x);
+typedef double Temperature;
+typedef Temperature (*TemperatureMaker)(double);
+typedef double (*TemperatureReader)(Temperature);
+
+Temperature kelvin(double x);
+Temperature celsius(double x);
+Temperature fahrenheit(double x);
+Temperature rankine(double x);
+double as_kelvin(Temperature t);
+double as_celsius(Temperature t);
+double as_fahrenheit(Temperature t);
+double as_rankine(Temperature t);
+
+
typedef double Volume;
typedef Volume (*VolumeMaker)(double);
typedef double (*VolumeReader)(Volume);