[Newbies] orientation of polygons

Michael Rice 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
> order.
>
> 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
> chosen.
> 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
> arbitrary.
>
> Note that mathematics doesn't seem to help much here.  The shoelace
> algorithm
> for computing the area of a polygon and Green's theorem both use a
> counter-clockwise
> orientation.  However simple integration to determine the area under a
> curve implies
> a clockwise orientation (adding areas under each edge of the polygon when
> going
> left to right and subtracting when going right to left implied a
> clockwise orientation).
>
> Thanks
>
> Ralph Boland
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20190309/8c7aab0d/attachment.html>


More information about the Beginners mailing list