[R] Is a point into an ellipse
Duncan Murdoch
murdoch at stats.uwo.ca
Wed Apr 8 18:02:18 CEST 2009
On 4/8/2009 11:17 AM, Alain Guillet wrote:
> Hi,
>
> I drew an ellipse with the package ellipse. Now I would like to know if
> a point is inside the ellipse. Is any R functions to do it without
> computing the equation of the ellipse manually? Thanks.
>
> For example, if I do "plot(ellipse(0.8), type = 'l')", I would like to
> know if (0,1) belongs to the drawn ellipse.
It's probably too late by then, but if you saved the result of the call
to ellipse(0.8), and treat it as a polygon, there is the function
point.in.polygon in the sp package, or pip in splancs, or inside in
RFOC, or inside in GEOmap, etc.
Duncan Murdoch
More information about the R-help
mailing list