Beispiel #1
0
 def test_square(self):
     v = np.array([[0, 0],
                   [0, 1],
                   [1, 1],
                   [1, 0]])
     assert(points_inside_poly([[0.5, 0.5]], v)[0])
     assert(not points_inside_poly([[-0.1, 0.1]], v)[0])
Beispiel #2
0
 def test_triangle(self):
     v = np.array([[0, 0],
                   [1, 0],
                   [0.5, 0.75]])
     assert(points_inside_poly([[0.5, 0.7]], v)[0])
     assert(not points_inside_poly([[0.5, 0.76]], v)[0])
     assert(not points_inside_poly([[0.7, 0.5]], v)[0])
Beispiel #3
0
 def test_square(self):
     v = np.array([[0, 0],
                   [0, 1],
                   [1, 1],
                   [1, 0]])
     assert(points_inside_poly([[0.5, 0.5]], v)[0])
     assert(not points_inside_poly([[-0.1, 0.1]], v)[0])
Beispiel #4
0
 def test_triangle(self):
     v = np.array([[0, 0],
                   [1, 0],
                   [0.5, 0.75]])
     assert(points_inside_poly([[0.5, 0.7]], v)[0])
     assert(not points_inside_poly([[0.5, 0.76]], v)[0])
     assert(not points_inside_poly([[0.7, 0.5]], v)[0])
Beispiel #5
0
 def test_type(self):
     assert(points_inside_poly([[0, 0]], [[0, 0]]).dtype == np.bool)
Beispiel #6
0
 def test_type(self):
     assert (points_inside_poly([[0, 0]], [[0, 0]]).dtype == np.bool)