projects
/
master-thesis.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
beginning of the classifier.
[master-thesis.git]
/
Parasitemia
/
Parasitemia
/
Types.fs
diff --git
a/Parasitemia/Parasitemia/Types.fs
b/Parasitemia/Parasitemia/Types.fs
index
308fc6b
..
589a735
100644
(file)
--- a/
Parasitemia/Parasitemia/Types.fs
+++ b/
Parasitemia/Parasitemia/Types.fs
@@
-2,7
+2,14
@@
open System
open System
-type Ellipse = { cx: float; cy: float; a: float; b: float; alpha: float }
-
+type Ellipse (cx: float, cy: float, a: float, b: float, alpha: float) =
+ member this.Cx = cx
+ member this.Cy = cy
+ member this.A = a
+ member this.B = b
+ member this.Alpha = alpha
+ member this.Area = a * b * Math.PI
-//type PointImg = { x: int; y: int }
\ No newline at end of file
+ // Does the ellipse contain the point (x, y)?.
+ member this.Contains x y =
+ ((x - cx) * cos alpha + (y - cy) * sin alpha) ** 2.0 / a ** 2.0 + ((x - cx) * sin alpha - (y - cy) * cos alpha) ** 2.0 / b ** 2.0 <= 1.0
\ No newline at end of file