diff trafficintelligence/tests/moving.txt @ 1106:799ef82caa1a v0.2.4

added code to compute bounding rectangle around each user
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 15 Mar 2019 15:58:37 -0400
parents b3f8b26ee838
children 6bbcd9433732
line wrap: on
line diff
--- a/trafficintelligence/tests/moving.txt	Thu Mar 14 17:08:05 2019 -0400
+++ b/trafficintelligence/tests/moving.txt	Fri Mar 15 15:58:37 2019 -0400
@@ -75,6 +75,12 @@
 >>> Point.distanceNorm2(Point(3,4),Point(1,7))
 3.605551275463989
 
+>>> Point.boundingRectangle([Point(0,0), Point(1,0), Point(0,1), Point(1,1)], Point(1, 1))
+[(0.500000,1.500000), (1.500000,0.500000), (0.500000,-0.500000), (-0.500000,0.500000)]
+>>> Point.boundingRectangle([Point(0,0), Point(1,0), Point(0,1), Point(1,1)], Point(-1, -1))
+[(0.500000,-0.500000), (-0.500000,0.500000), (0.500000,1.500000), (1.500000,0.500000)]
+
+
 >>> Point(3,2).inPolygon(np.array([[0,0],[1,0],[1,1],[0,1]]))
 False
 >>> Point(3,2).inPolygon(np.array([[0,0],[4,0],[4,3],[0,3]]))