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 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_inside_poly([[0,0]],p.get_path().vertices) > > returns True > > What am I missing here? > > Thanks! > > > ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users