Mercurial > hg > nsaunier > traffic-intelligence
comparison python/tests/moving.txt @ 43:6d11d9e7ad4e
methods for trajectories and objects
to add and subtract trajectories
and extract objects from existing objects, for sub-time intervals
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 14 Jul 2010 14:02:11 -0400 |
| parents | |
| children | cc192d0450b3 |
comparison
equal
deleted
inserted
replaced
| 42:1a2ac2d4f53a | 43:6d11d9e7ad4e |
|---|---|
| 1 >>> from moving import * | |
| 2 | |
| 3 >>> Interval().empty() | |
| 4 True | |
| 5 >>> Interval(0,1).empty() | |
| 6 False | |
| 7 >>> Interval(0,1).length() | |
| 8 1 | |
| 9 >>> Interval(23.2,24.9).length() | |
| 10 1.6999999999999993 | |
| 11 >>> Interval(10,8).length() | |
| 12 0 | |
| 13 | |
| 14 >>> TimeInterval(0,1).length() | |
| 15 2 | |
| 16 >>> TimeInterval(10,8).length() | |
| 17 0 | |
| 18 | |
| 19 >>> Point(3,4)-Point(1,7) | |
| 20 (2.000000,-3.000000) | |
| 21 | |
| 22 >>> Point(3,2).norm2Squared() | |
| 23 13 | |
| 24 | |
| 25 >>> Point.distanceNorm2(Point(3,4),Point(1,7)) | |
| 26 3.6055512754639891 | |
| 27 |
