Mercurial > hg > nsaunier > traffic-intelligence
comparison python/moving.py @ 28:9ae709a2e8d0
rearranged code
| author | Nicolas Saunier <nico@confins.net> |
|---|---|
| date | Sat, 30 Jan 2010 21:42:53 -0500 |
| parents | 44689029a86f |
| children | 418b41056e6c |
comparison
equal
deleted
inserted
replaced
| 27:44689029a86f | 28:9ae709a2e8d0 |
|---|---|
| 138 ''' | 138 ''' |
| 139 >>> Point(3,4)-Point(1,7) | 139 >>> Point(3,4)-Point(1,7) |
| 140 (2.000000,-3.000000) | 140 (2.000000,-3.000000) |
| 141 ''' | 141 ''' |
| 142 return Point(self.x-other.x, self.y-other.y) | 142 return Point(self.x-other.x, self.y-other.y) |
| 143 | |
| 144 def aslist(self): | |
| 145 return [self.x, self.y] | |
| 143 | 146 |
| 144 class Trajectory: | 147 class Trajectory: |
| 145 '''Class for trajectories | 148 '''Class for trajectories |
| 146 i.e. a temporal sequence of positions | 149 i.e. a temporal sequence of positions |
| 147 | 150 |
