[Matplotlib-users] Polygon contains_point() different from matplotlib.nxutils.points_inside_poly?

2012-02-13 Thread reckoner
I'm trying to test whether or not the origin is contained inside the following triangle inscribed inside a circle: >>> th = array([ 2.3913423, 5.3133123, 1.8516171]) >>> p=patch.Polygon(array([cos(th),sin(th)]).T) >>> p.contains_point((0,0)) returns 0 but, >>> matplotlib.nxutils.points_insi

Re: [Matplotlib-users] Polygon contains_point() different from matplotlib.nxutils.points_inside_poly?

2012-02-13 Thread Jerzy Karczmarczuk
Le 13/02/2012 17:47, reckoner a écrit : I'm trying to test whether or not the origin is contained inside the following triangle inscribed inside a circle: > th = array([ 2.3913423, 5.3133123, 1.8516171]) > p=patch.Polygon(array([cos(th),sin(th)]).T) What do you mean by "patch" here? I tested

Re: [Matplotlib-users] Polygon contains_point() different from matplotlib.nxutils.points_inside_poly?

2012-02-13 Thread reckoner
Here's a better example: >>> th= array([ 4.65542641, 5.32920696, 2.20928291]) >>> p=patch.Polygon(array([cos(th),sin(th)]).T) >>> print p.contains_point((0,0)) 1 >>> print matplotlib.nxutils.pnpoly(0,0,p.get_path().vertices) 0 Thanks! On 2/13/2012 8:47 AM, reckoner wrote: > I'm trying to te

Re: [Matplotlib-users] Polygon contains_point() different from matplotlib.nxutils.points_inside_poly?

2012-02-13 Thread Benjamin Root
On Mon, Feb 13, 2012 at 1:33 PM, reckoner wrote: > Here's a better example: > > >>> th= array([ 4.65542641, 5.32920696, 2.20928291]) > >>> p=patch.Polygon(array([cos(th),sin(th)]).T) > >>> print p.contains_point((0,0)) > 1 > >>> print matplotlib.nxutils.pnpoly(0,0,p.get_path().vertices) > 0 > >

Re: [Matplotlib-users] Polygon contains_point() different from matplotlib.nxutils.points_inside_poly?

2012-02-13 Thread Jerzy Karczmarczuk
reckoner: >>> th= array([ 4.65542641, 5.32920696, 2.20928291]) >>> p=patch.Polygon(array([cos(th),sin(th)]).T) >>> print p.contains_point((0,0)) 1 >>> print matplotlib.nxutils.pnpoly(0,0,p.get_path().vertices) 0 Thanks! I can confirm this for both the current

Re: [Matplotlib-users] Polygon contains_point() different from matplotlib.nxutils.points_inside_poly?

2012-02-13 Thread Benjamin Root
On Mon, Feb 13, 2012 at 2:59 PM, Jerzy Karczmarczuk < jerzy.karczmarc...@unicaen.fr> wrote: > > reckoner: > > >> >> >>> th= array([ 4.65542641, 5.32920696, 2.20928291]) >> >>> p=patch.Polygon(array([cos(th),sin(th)]).T) >> >>> print p.contains_point((0,0)) >> 1 >> >>> print matplotlib.nxutils.p