Add a logger assembly and split the main assembly in two : the UI and the parasitemia...
[master-thesis.git] / Parasitemia / ParasitemiaCore / UnitsOfMeasure.fs
diff --git a/Parasitemia/ParasitemiaCore/UnitsOfMeasure.fs b/Parasitemia/ParasitemiaCore/UnitsOfMeasure.fs
new file mode 100644 (file)
index 0000000..81ce51f
--- /dev/null
@@ -0,0 +1,16 @@
+module ParasitemiaCore.UnitsOfMeasure
+
+[<Measure>] type px
+[<Measure>] type μm
+[<Measure>] type inch
+[<Measure>] type ppi = px / inch
+
+let μmInchRatio = 25.4e3<μm/inch>
+
+let μmToInch(x: float<μm>) : float<inch> = x / μmInchRatio
+let inchToμm(x: float<inch>) : float<μm> = x * μmInchRatio
+
+
+
+
+