X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FEEOver.fs;h=5a3c9e4c580be0c6f6feb74a71c8503a261d1bb1;hp=528632ad29fc856a6fb78d03015611dbc0e9b3a0;hb=044b0ae69df3ac565432545b2fa934589016f9bd;hpb=53440e757b4a4ab2a81b0f6a5dd1a2002c0133ba diff --git a/Parasitemia/Parasitemia/EEOver.fs b/Parasitemia/Parasitemia/EEOver.fs index 528632a..5a3c9e4 100644 --- a/Parasitemia/Parasitemia/EEOver.fs +++ b/Parasitemia/Parasitemia/EEOver.fs @@ -514,9 +514,9 @@ let private biquadroots (p: float[]) (r: float[,]) = quad () // Return a tuple (area, x intersections, y intersections) -let EEOverlapArea (e1: Types.Ellipse) (e2: Types.Ellipse) : (float * float[] * float[]) option = - let h1, k1, a1, b1, phi_1 = e1.Cx, e1.Cy, e1.A, e1.B, e1.Alpha - let h2, k2, a2, b2, phi_2 = e2.Cx, e2.Cy, e2.A, e2.B, e2.Alpha +let EEOverlapArea (e1: Types.Ellipse) (e2: Types.Ellipse) : (float32 * float32[] * float32[]) option = + let h1, k1, a1, b1, phi_1 = float e1.Cx, float e1.Cy, float e1.A, float e1.B, float e1.Alpha + let h2, k2, a2, b2, phi_2 = float e2.Cx, float e2.Cy, float e2.A, float e2.B, float e2.Alpha if a1 <= EPS || b1 <= EPS || a2 <= EPS || b2 <= EPS then @@ -718,11 +718,11 @@ let EEOverlapArea (e1: Types.Ellipse) (e2: Types.Ellipse) : (float * float[] * f | 4 -> fourintpts xint yint a1 b1 phi_1 a2 b2 h2_tr k2_tr phi_2 aa bb cc dd ee ff | _ -> -1.0 if nintpts = 0 - then Some (area, [||], [||]) + then Some (float32 area, [||], [||]) else - let xTransform = Array.zeroCreate nintpts - let yTransform = Array.zeroCreate nintpts + let xTransform : float32[] = Array.zeroCreate nintpts + let yTransform : float32[] = Array.zeroCreate nintpts for i in 0 .. (nintpts - 1) do - xTransform.[i] <- cos phi_1 * xint.[i] - sin phi_1 * yint.[i] + h1 - yTransform.[i] <- sin phi_1 * xint.[i] + cos phi_1 * yint.[i] + k1 - Some (area, xTransform, yTransform) \ No newline at end of file + xTransform.[i] <- float32 <| cos phi_1 * xint.[i] - sin phi_1 * yint.[i] + h1 + yTransform.[i] <- float32 <| sin phi_1 * xint.[i] + cos phi_1 * yint.[i] + k1 + Some (float32 area, xTransform, yTransform) \ No newline at end of file