Following are the list of points,
let points = [ [ 42.34624, -71.06024 ], [ 42.33558, -71.06616 ], [ 42.32632, -71.05835 ], [ 42.32987, -71.05428 ], [ 42.34732, -71.05432 ], [ 42.34618, -71.05973 ], [ 42.34624, -71.06024 ] ]; let testPoint = [ [42.33288, -71.05804] ];` let isInside = pp(testPoint, points); expect(isInside).to.equal(true); // always fails
I'm not sure why it fails though. Is it because the algorithm doesn't cope with this "type" of polygon? Any hints please? Please point me to any alternatives to this approach as well.