diff python/tests/moving.txt @ 79:5d487f183fe2

added method to test points in polygons and tests
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 11 Mar 2011 18:12:29 -0500
parents cc192d0450b3
children daa05fae1a70
line wrap: on
line diff
--- a/python/tests/moving.txt	Fri Feb 25 14:25:34 2011 -0500
+++ b/python/tests/moving.txt	Fri Mar 11 18:12:29 2011 -0500
@@ -25,11 +25,18 @@
 >>> Point.distanceNorm2(Point(3,4),Point(1,7))
 3.6055512754639891
 
+>>> Point(3,2).inPolygon([Point(0,0),Point(1,0),Point(1,1),Point(0,1)])
+False
+>>> Point(3,2).inPolygon([Point(0,0),Point(4,0),Point(4,3),Point(0,3)])
+True
+
 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]])
 >>> t1.length()
 3
 >>> t1[1]
 (1.500000,3.500000)
+>>> t1.getTrajectoryInPolygon1([Point(0,0),Point(4,0),Point(4,3),Point(0,3)])
+(0.500000,0.500000)
 
 >>> indic1 = TemporalIndicator('bla', [0,3,-4], TimeInterval(4,6))
 >>> indic1.empty()