> > > Message: 1 > Date: Sat, 8 Jun 2013 11:06:05 -0600 > From: Dar Scott <d...@swcp.com> > To: How to use LiveCode <use-livecode@lists.runrev.com> > Subject: Re: Polygon's share of its rectangle inconsistent? > Message-ID: <eb5d4974-e672-4afd-9b5f-c353e4aa5...@swcp.com> > Content-Type: text/plain; charset=windows-1252 > > (Snip) > > I'm not sure what "singly connected" means. Does this mean a graphic can > work like several graphics? > > Dar >
Hi Dar, The code I offered for obtaining the area within a closed, singly connected polygon relied on the sum of the areas underneath a connected series of line segments equates to the area within those segments. The area under a single line segment defined by it's end points x1,y1 and x2,y2 is given by (x2 - x1) * (y1 + y2)/2 The area under the "top" of the polygon (where x2 - x1) is positive) minus the area under the "bottom" (where x1 - x2 is negative) is equal to the area within. This presumes one moves clockwise around the polygon. Going counter-clockwise the area calculated is negative. For a symmetric, doubly connected figure, such as a figure 8, there is a clockwise segment and an equal and opposite counter-clockwise segment, resulting in zero net area. A figure is singly connected if it is possible to move to every point within, without crossing a line. The figure "0" is singly connected; the figure "8" is doubly connected. Jim _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode