X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FTypes.fs;h=e27f7d0760dff6a765b15ce10c5b44358d8e84ee;hb=6d99ab0dadc57e91cd846844b620fc90b52a2f96;hp=d7bacbd2f4d097c3e75cc4bc405e58c33d582cf5;hpb=5b68d946369f998865d2dd330fd3b374b2b9a0ad;p=master-thesis.git diff --git a/Parasitemia/Parasitemia/Types.fs b/Parasitemia/Parasitemia/Types.fs index d7bacbd..e27f7d0 100644 --- a/Parasitemia/Parasitemia/Types.fs +++ b/Parasitemia/Parasitemia/Types.fs @@ -30,6 +30,16 @@ type Ellipse (cx: float, cy: float, a: float, b: float, alpha: float) = this.CutAVericalLine 0.0 || this.CutAVericalLine width || this.CutAnHorizontalLine 0.0 || this.CutAnHorizontalLine height + member this.Scale (factor: float) = + Ellipse(this.Cx, this.Cy, this.A * factor, this.B * factor, alpha) + + // Approximation of Ramanujan. + member this.Perimeter = + Math.PI * (3.0 * (this.A + this.B) - sqrt ((3.0 * this.A + this.B) * (this.A + 3.0 * this.B))) + + override this.ToString () = + sprintf "(cx: %A, cy: %A, a: %A, b: %A, alpha: %A)" this.Cx this.Cy this.A this.B this.Alpha + type CellClass = HealthyRBC | InfectedRBC | Peculiar @@ -42,6 +52,7 @@ type Cell = { type Line (a: float, b: float) = member this.A = a member this.B = b + member this.Valid = not (Double.IsInfinity this.A) [] type PointD (x: float, y: float) =