comparison python/tests/moving.txt @ 577:d0abd2ee17b9

changed arguments to type Point
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 28 Aug 2014 17:22:38 -0400
parents 0eff0471f9cb
children 7e1ae4d97f1a
comparison
equal deleted inserted replaced
576:0eff0471f9cb 577:d0abd2ee17b9
65 >>> segmentIntersection(Point(0,1), Point(0,3), Point(1,0), Point(3,1)) 65 >>> segmentIntersection(Point(0,1), Point(0,3), Point(1,0), Point(3,1))
66 >>> segmentIntersection(Point(0.,0.), Point(2.,2.), Point(0.,2.), Point(2.,0.)) 66 >>> segmentIntersection(Point(0.,0.), Point(2.,2.), Point(0.,2.), Point(2.,0.))
67 (1.000000,1.000000) 67 (1.000000,1.000000)
68 >>> segmentIntersection(Point(0,1), Point(1,2), Point(2,0), Point(3,2)) 68 >>> segmentIntersection(Point(0,1), Point(1,2), Point(2,0), Point(3,2))
69 69
70 >>> left = [(92.291666666666686, 102.99239033124439), (56.774193548387103, 69.688898836168306)] 70 >>> left = Trajectory.fromPointList([(92.291666666666686, 102.99239033124439), (56.774193548387103, 69.688898836168306)])
71 >>> middle = [(87.211021505376351, 93.390778871978512), (59.032258064516128, 67.540286481647257)] 71 >>> middle = Trajectory.fromPointList([(87.211021505376351, 93.390778871978512), (59.032258064516128, 67.540286481647257)])
72 >>> right = [(118.82392473118281, 115.68263205013426), (63.172043010752688, 66.600268576544309)] 72 >>> right = Trajectory.fromPointList([(118.82392473118281, 115.68263205013426), (63.172043010752688, 66.600268576544309)])
73 >>> alignments = [left, middle, right] 73 >>> alignments = [left, middle, right]
74 >>> getSYfromXY(73, 82, alignments) 74 >>> for a in alignments: a.computeCumulativeDistances()
75 [1, 0, 73.81997726720346, 81.10617000672484, 18.172277808821125, 18.172277808821125, 1.2129694042343868] 75 >>> getSYfromXY(Point(73, 82), alignments)
76 >>> getSYfromXY(78, 83, alignments, 0.5) 76 [1, 0, (73.819977,81.106170), 18.172277808821125, 18.172277808821125, 1.2129694042343868]
77 [1, 0, 77.03318826883, 84.05388936710071, 13.811799123113715, 13.811799123113715, -1.4301775140225983] 77 >>> getSYfromXY(Point(78, 83), alignments, 0.5)
78 [1, 0, (77.033188,84.053889), 13.811799123113715, 13.811799123113715, -1.4301775140225983]
78 79
79 >>> Trajectory().length() 80 >>> Trajectory().length()
80 0 81 0
81 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]]) 82 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]])
82 >>> t1.length() == 3. 83 >>> t1.length() == 3.
99 >>> t1.computeCumulativeDistances() 100 >>> t1.computeCumulativeDistances()
100 >>> t1.getDistance(0) 101 >>> t1.getDistance(0)
101 2.23606797749979 102 2.23606797749979
102 >>> t1.getDistance(1) 103 >>> t1.getDistance(1)
103 5.385164807134504 104 5.385164807134504
105 >>> t1.getDistance(2)
106 Index 2 beyond trajectory length 3-1
107 >>> t1.getCumulativeDistance(0)
108 0.0
104 >>> t1.getCumulativeDistance(1) 109 >>> t1.getCumulativeDistance(1)
110 2.23606797749979
111 >>> t1.getCumulativeDistance(2)
105 7.6212327846342935 112 7.6212327846342935
106 >>> t1.getCumulativeDistance(2) 113 >>> t1.getCumulativeDistance(3)
107 Index 2 beyond trajectory length 3-1 114 Index 3 beyond trajectory length 3
108 115
109 116
110 >>> from utils import LCSS 117 >>> from utils import LCSS
111 >>> lcss = LCSS(lambda x,y: Point.distanceNorm2(x,y) <= 0.1) 118 >>> lcss = LCSS(lambda x,y: Point.distanceNorm2(x,y) <= 0.1)
112 >>> Trajectory.lcss(t1, t1, lcss) 119 >>> Trajectory.lcss(t1, t1, lcss)