polygon detects edge-collinear and edge-contained points