Mercurial > hg > nsaunier > traffic-intelligence
comparison python/tests/moving.txt @ 92:a5ef9e40688e
makes use of matplotlib function to test if point is in a polygon
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Sun, 12 Jun 2011 03:24:55 -0400 |
| parents | daa05fae1a70 |
| children | 9928c2fa72cc |
comparison
equal
deleted
inserted
replaced
| 91:daa05fae1a70 | 92:a5ef9e40688e |
|---|---|
| 1 >>> from moving import * | 1 >>> from moving import * |
| 2 >>> import numpy as np | |
| 2 | 3 |
| 3 >>> Interval().empty() | 4 >>> Interval().empty() |
| 4 True | 5 True |
| 5 >>> Interval(0,1).empty() | 6 >>> Interval(0,1).empty() |
| 6 False | 7 False |
| 33 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]]) | 34 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]]) |
| 34 >>> t1.length() == 3. | 35 >>> t1.length() == 3. |
| 35 True | 36 True |
| 36 >>> t1[1] | 37 >>> t1[1] |
| 37 (1.500000,3.500000) | 38 (1.500000,3.500000) |
| 38 >>> t1.getTrajectoryInPolygon1([Point(0,0),Point(4,0),Point(4,3),Point(0,3)]) | 39 >>> t1.getTrajectoryInPolygon(np.array([[0,0],[4,0],[4,3],[0,3]])) |
| 39 (0.500000,0.500000) | 40 (0.500000,0.500000) |
| 40 | 41 |
| 41 >>> indic1 = TemporalIndicator('bla', [0,3,-4], TimeInterval(4,6)) | 42 >>> indic1 = TemporalIndicator('bla', [0,3,-4], TimeInterval(4,6)) |
| 42 >>> indic1.empty() | 43 >>> indic1.empty() |
| 43 False | 44 False |
