Mercurial > hg > nsaunier > traffic-intelligence
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 1105:e62c2f5e25e6 | 1106:799ef82caa1a |
|---|---|
| 72 >>> Point(3,2).norm2Squared() | 72 >>> Point(3,2).norm2Squared() |
| 73 13 | 73 13 |
| 74 | 74 |
| 75 >>> Point.distanceNorm2(Point(3,4),Point(1,7)) | 75 >>> Point.distanceNorm2(Point(3,4),Point(1,7)) |
| 76 3.605551275463989 | 76 3.605551275463989 |
| 77 | |
| 78 >>> Point.boundingRectangle([Point(0,0), Point(1,0), Point(0,1), Point(1,1)], Point(1, 1)) | |
| 79 [(0.500000,1.500000), (1.500000,0.500000), (0.500000,-0.500000), (-0.500000,0.500000)] | |
| 80 >>> Point.boundingRectangle([Point(0,0), Point(1,0), Point(0,1), Point(1,1)], Point(-1, -1)) | |
| 81 [(0.500000,-0.500000), (-0.500000,0.500000), (0.500000,1.500000), (1.500000,0.500000)] | |
| 82 | |
| 77 | 83 |
| 78 >>> Point(3,2).inPolygon(np.array([[0,0],[1,0],[1,1],[0,1]])) | 84 >>> Point(3,2).inPolygon(np.array([[0,0],[1,0],[1,1],[0,1]])) |
| 79 False | 85 False |
| 80 >>> Point(3,2).inPolygon(np.array([[0,0],[4,0],[4,3],[0,3]])) | 86 >>> Point(3,2).inPolygon(np.array([[0,0],[4,0],[4,3],[0,3]])) |
| 81 True | 87 True |
