Example #1
0
 def test_polygon8(self): # trojkat
     L = [Point(0, 0), Point(2, 0), Point(1, 2)]
     expected = [(Point(0, 0), Point(2, 0)),
         (Point(0, 0), Point(1, 2)),
         (Point(2, 0), Point(1, 2))]
     result = list(iter_all_antipodal_pairs(L))
     self.assertEqual(result, expected)
Example #2
0
 def test_polygon1(self): # nie ma rownoleglych krawedzi
     L = [Point(0, 0), Point(1, 0), Point(2, 1), Point(0, 2)]
     expected = [(Point(0, 0), Point(2, 1)),
         (Point(0, 0), Point(0, 2)),
         (Point(1, 0), Point(0, 2)),
         (Point(2, 1), Point(0, 2))]
     result = list(iter_all_antipodal_pairs(L))
     self.assertEqual(result, expected)
Example #3
0
 def test_polygon2(self): # jedna para krawedzi rownoleglych
     L = [Point(0, 0), Point(1, 0), Point(2, 1), Point(0, 1)]
     expected = [(Point(0, 0), Point(2, 1)),
         (Point(0, 0), Point(0, 1)),
         (Point(1, 0), Point(2, 1)),
         (Point(1, 0), Point(0, 1)),
         (Point(2, 1), Point(0, 1))]
     result = list(iter_all_antipodal_pairs(L))
     self.assertEqual(result, expected)
Example #4
0
 def test_polygon5(self): # pieciokat
     L = [Point(1, 0), Point(3, 0), Point(4, 2), Point(2, 3), Point(0, 2)]
     expected = [(Point(1, 0), Point(4, 2)),
         (Point(1, 0), Point(2, 3)),
         (Point(3, 0), Point(2, 3)),
         (Point(3, 0), Point(0, 2)),
         (Point(4, 2), Point(0, 2))]
     result = list(iter_all_antipodal_pairs(L))
     self.assertEqual(result, expected)
Example #5
0
 def test_polygon4(self): # prostokat
     L = [Point(0, 0), Point(2, 0), Point(2, 1), Point(0, 1)]
     expected = [(Point(0, 0), Point(2, 0)),
         (Point(0, 0), Point(2, 1)),
         (Point(0, 0), Point(0, 1)),
         (Point(2, 0), Point(2, 1)),
         (Point(2, 0), Point(0, 1)),
         (Point(2, 1), Point(0, 1))]
     result = list(iter_all_antipodal_pairs(L))
     self.assertEqual(result, expected)
Example #6
0
 def test_polygon7(self): # szesciokat
     L = [Point(0, 0), Point(1, 0), Point(2, 1), Point(3, 3),
         Point(1, 2), Point(0, 1)]
     expected = [(Point(0, 0), Point(3, 3)),
         (Point(1, 0), Point(3, 3)),
         (Point(1, 0), Point(1, 2)),
         (Point(1, 0), Point(0, 1)),
         (Point(2, 1), Point(1, 2)),
         (Point(2, 1), Point(0, 1)),
         (Point(3, 3), Point(0, 1))]
     result = list(iter_all_antipodal_pairs(L))
     self.assertEqual(result, expected)
Example #7
0
 def test_polygon6(self): # szesciokat symetryczny
     L = [Point(2, 0), Point(4, 1), Point(4, 3), Point(2, 4),
         Point(0, 3), Point(0, 1)]
     expected = [(Point(2, 0), Point(4, 3)),
         (Point(2, 0), Point(2, 4)),
         (Point(2, 0), Point(0, 3)),
         (Point(4, 1), Point(2, 4)),
         (Point(4, 1), Point(0, 3)),
         (Point(4, 1), Point(0, 1)),
         (Point(4, 3), Point(0, 3)),
         (Point(4, 3), Point(0, 1)),
         (Point(2, 4), Point(0, 1))]
     result = list(iter_all_antipodal_pairs(L))
     self.assertEqual(result, expected)