[Newbies] orientation of polygons
limitcase at gmail.com
Sun Mar 10 01:06:06 UTC 2019
Is there some purpose for this endeavor? I once wrote a program that was
used to compute highway construction fill quantities. I don't remember what
method I used, probably Green's theorem, as the shoelace doesn't ring any
bells. One important note: the origin chosen should lie close to the center
of the area one wishes to measure, for the most accurate results.
On Fri, Mar 8, 2019 at 2:24 AM Ralph Boland <rpboland at gmail.com> wrote:
> In Squeak should the vertices of a polygon be listed in clockwise or
> counter-clockwise order?
> Note that I am not concerned about which is best, just which Squeak uses.
> I need to make a choice in order to compute the areas of polygons and
> the algorithms
> that do this negate the area if you process the vertices in the opposite
> Note that it is not sufficient to just take the absolute value of the
> result of computing the area
> because I have to deal with a polygon being cut into two parts by a
> line seqment (a chord).
> Which of the two parts of the polygon I want the area of is determined
> by the ordering
> of the vertices of the polygon and also the ordering of the the
> vertices of the line segment.
> Reversing the ordering of the vertices of either switches the subpolygon
> Reversing both has no affect because the two switches cancel.
> So I have to make a choice and live with it. I want my choice to be
> consistent with
> any similar choice made in Squeak code.
> If none of the Squeak code depends on polygon vertices ordering then I
> would like
> to hear opinions on the matter so at least I can a decision that is at
> least better then
> Note that mathematics doesn't seem to help much here. The shoelace
> for computing the area of a polygon and Green's theorem both use a
> orientation. However simple integration to determine the area under a
> curve implies
> a clockwise orientation (adding areas under each edge of the polygon when
> left to right and subtracting when going right to left implied a
> clockwise orientation).
> Ralph Boland
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners