diff options
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/Math.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/api/Math.py b/src/api/Math.py index 1c02a11..41d67ae 100644 --- a/src/api/Math.py +++ b/src/api/Math.py @@ -70,4 +70,18 @@ def pointInsidePolygon(x, y, poly): inside = not inside
p1x,p1y = p2x,p2y
- return inside
\ No newline at end of file + return inside
+
+
+def pointInsideRectangle(x, y, rect):
+
+ x1 = rect[0][0]
+ y1 = rect[0][1]
+ x2 = rect[1][0]
+ y2 = rect[1][1]
+
+ if (x > x1) and (x < x2):
+ if (y > y1) and (y < y2):
+ return True
+ return False
+
\ No newline at end of file |