Skip to content
Back to formatted view

Raw Message

Message-ID: <49DCCA8A.1070301@stats.uwo.ca>
Date: 2009-04-08T16:02:18Z
From: Duncan Murdoch
Subject: Is a point into an ellipse
In-Reply-To: <49DCC018.70205@uclouvain.be>

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