I have the x,y co-ordinates for a bounding ellipsoid in a data.frame. And then I have several query x,y co-ordinates in a data.fame. The x,y co-ordinates for a bounding ellipsoid was calculated using the function…
exy <- ellipsoidhull(X[,1:2])
such that….
plot(predict(exy), xlim=c(-0.018, 0.015), ylim=c(-0.018,0.015),
cex=0.1, type="l")
gives me a plot like this….

I have query like this….
V2 V3
-0.0167 -0.0137
-0.0159 -0.0127
-0.0150 -0.0127
-0.0164 -0.0137
-0.0164 -0.0134
-0.0173 -0.0131
How can I find which of the query is within/outside the bounding ellipsoid? Is there an R function to do this? Thanks
Package
mgcvoffers such function (but is not the only one – if you care to learn about spatial objects, see, for example,sp::overlay). This is example from thein.out()function.