Determine if the line segments intersect and if the points are inside the polygon