X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FEEOver.fs;h=52b59636eeadbe631cc74dcb44b706254e56deab;hp=81bdbf808fb08b746af7a7681c68b91503876ceb;hb=e76da913cd58078ad2479357b2430ed62a6e0777;hpb=06bd63d8c01100c28873dfafd59b5efccbfb67e4 diff --git a/Parasitemia/Parasitemia/EEOver.fs b/Parasitemia/Parasitemia/EEOver.fs index 81bdbf8..52b5963 100644 --- a/Parasitemia/Parasitemia/EEOver.fs +++ b/Parasitemia/Parasitemia/EEOver.fs @@ -716,4 +716,12 @@ let EEOverlapArea (e1: Types.Ellipse) (e2: Types.Ellipse) : (float * float[] * f | 3 -> threeintpts xint yint a1 b1 phi_1 a2 b2 h2_tr k2_tr phi_2 aa bb cc dd ee ff | 4 -> fourintpts xint yint a1 b1 phi_1 a2 b2 h2_tr k2_tr phi_2 aa bb cc dd ee ff | _ -> -1.0 - Some (area, xint.[..nintpts-1], yint.[..nintpts-1]) \ No newline at end of file + if nintpts = 0 + then Some (area, [||], [||]) + else + let xTransform = Array.zeroCreate nintpts + let yTransform = 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