Matplotlib has a point_in_poly function that is pretty fast. This is taken straight from the matplotlib documentation: nxutils
In [25]: import numpy as np
In [26]: import matplotlib.nxutils as nx
In [27]: verts = np.array([ [0,0], [0, 1], [1, 1], [1,0]], float)
In [28]: nx.pnpoly( 0.5, 0.5, verts)
Out[28]: 1
In [29]: nx.pnpoly( 0.5, 1.5, verts)
Out[29]: 0
In [30]: points = np.random.rand(10,2)*2
In [31]: points
Out[31]:
array([[ 1.03597426, 0.61029911],
[ 1.94061056, 0.65233947],
[ 1.08593748, 1.16010789],
[ 0.9255139 , 1.79098751],
[ 1.54564936, 1.15604046],
[ 1.71514397, 1.26147554],
[ 1.19133536, 0.56787764],
[ 0.40939549, 0.35190339],
[ 1.8944715 , 0.61785408],
[ 0.03128518, 0.48144145]])
In [32]: nx.points_inside_poly(points, verts)
Out[32]: array([False, False, False, False, False, False, False, True, False, True], dtype=bool)
After that, its just a matter of testing each point in the set and figuring out if both, one, or neither are inside the vertices.