Exemple #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])
Exemple #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])
Exemple #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])
Exemple #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])
Exemple #5
0
 def test_type(self):
     assert(points_inside_poly([[0, 0]], [[0, 0]]).dtype == np.bool)
 def test_type(self):
     assert (points_inside_poly([[0, 0]], [[0, 0]]).dtype == np.bool)