Mercurial Hosting > traffic-intelligence
comparison python/moving.py @ 19:5a21d2cfee44
added polygon plotting
author | Nicolas Saunier <nico@confins.net> |
---|---|
date | Fri, 27 Nov 2009 19:16:12 -0500 |
parents | 9d6831cfe675 |
children | 3c4629550f5f |
comparison
equal
deleted
inserted
replaced
18:ef35d5f111e4 | 19:5a21d2cfee44 |
---|---|
119 # def add(x, y): return x+y | 119 # def add(x, y): return x+y |
120 # sq = map(add, [x*x for x in self.positions[0]], [y*y for y in self.positions[1]]) | 120 # sq = map(add, [x*x for x in self.positions[0]], [y*y for y in self.positions[1]]) |
121 # return sqrt(sq) | 121 # return sqrt(sq) |
122 return [hypot(x,y) for x,y in zip(self.positions[0], self.positions[1])] | 122 return [hypot(x,y) for x,y in zip(self.positions[0], self.positions[1])] |
123 | 123 |
124 def getTrajectoryInPolygon(self, polygon): | |
125 'Returns the set of points inside the polygon' | |
126 # use shapely polygon contains | |
127 pass | |
128 | |
124 class MovingObject(STObject): | 129 class MovingObject(STObject): |
125 '''Class for moving objects | 130 '''Class for moving objects |
126 i.e. with a trajectory and a geometry (volume) | 131 i.e. with a trajectory and a geometry (volume) |
127 and a type (e.g. road user) | 132 and a type (e.g. road user) |
128 ''' | 133 ''' |