def test_points_in_poly_array_one_element():

    assert np.array_equal( points_in_poly( poly1, ( (0.5, 0.5, 0.0), ) ),
                          np.array((True,)) 
                          )

    assert np.array_equal( points_in_poly( poly1, ( (1.5, -0.5, 0.0), ) ),
                          np.array((False,)) 
                          )
def test_points_in_poly_array():
    points = np.array( ((0.5, 0.5, 0.0),
                        (1.5, 0.5, 0.0),
                        (0.5, 0.5, 0.0),
                        (0.5, 0.5, 0.0),
                        (-0.5, 0.5, 0.0),
                        (0.5, 0.5, 0.0),) )

    result = np.array((True,
                       False,
                       True,
                       True,
                       False,
                       True,
                       )) 

    assert np.array_equal( points_in_poly( poly1, points),
                          result )
def test_points_in_poly_scalar():

    assert points_in_poly( poly1, (0.5, 0.5, 0.0)) is True

    assert points_in_poly( poly1, (1.5, 0.5, 0.0)) is False