Hi, pip2d() doesn't seem to work correctly for me. I have a plot of a triangle that a query point fits inside, but the point is defined as outside the polygon by pip2d.
library(ptinpoly) verts <- matrix(c(594891,115309,594444,117201,594891,117201), ncol=2, byrow=T) query <- matrix(c(594885.0,115435.0), ncol=2, byrow=T) pip2d(Vertices = verts, Queries = query) # result = -1 # contrary to -1 output of pip2d, plot shows point lies within triangle plot(c(594400, 595000), c(115000, 117500), type="n") polygon(verts, border="red") points(x=query[,1], y=query[,2], col="blue") Scott Waichler Pacific Northwest National Laboratory Richland, WA, USA ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.