The sp package has a point in polygon function that I've tried to implement into the bezier functions