36c949542e8e909662d92032418f35420e19cff2
[master-thesis.git] / Parasitemia / ParasitemiaCore / UnitsOfMeasure.fs
1 module ParasitemiaCore.UnitsOfMeasure
2
3 [<Measure>] type px // Pixel.
4 [<Measure>] type μm
5 [<Measure>] type inch
6 [<Measure>] type ppi = px / inch // Pixel per inch.
7
8 let μmInchRatio = 25.4e3<μm/inch>
9
10 let μmToInch(x: float<μm>) : float<inch> = x / μmInchRatio
11 let inchToμm(x: float<inch>) : float<μm> = x * μmInchRatio
12