Mercurial Hosting > traffic-intelligence
diff python/moving.py @ 583:6ebfb43e938e
added midpoint function (from laurent gauthier)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 22 Sep 2014 16:21:53 -0400 |
parents | 7e1ae4d97f1a |
children | cf578ba866da 84690dfe5560 |
line wrap: on
line diff
--- a/python/moving.py Thu Sep 18 15:36:57 2014 -0400 +++ b/python/moving.py Mon Sep 22 16:21:53 2014 -0400 @@ -316,6 +316,10 @@ ttc = None return ttc + @staticmethod + def midPoint(p1, p2): + 'Returns the middle of the segment [p1, p2]' + return Point(0.5*p1.x+0.5*p2.x, 0.5*p1.y+0.5*p2.y) if shapelyAvailable: def pointsInPolygon(points, polygon):