<div dir="ltr">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. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 8, 2019 at 2:24 AM Ralph Boland <<a href="mailto:rpboland@gmail.com">rpboland@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In Squeak should the vertices of a polygon be listed in clockwise or<br>
counter-clockwise order?<br>
Note that I am not concerned about which is best, just which Squeak uses.<br>
I need to make a choice in order to compute the areas of polygons and<br>
the algorithms<br>
that do this negate the area if you process the vertices in the opposite order.<br>
<br>
Note that it is not sufficient to just take the absolute value of the<br>
result of computing the area<br>
because I have to deal with a polygon being cut into two parts by a<br>
line seqment (a chord).<br>
Which of the two parts of the polygon I want the area of is determined<br>
by the ordering<br>
of the vertices of the polygon and also the ordering of the the<br>
vertices of the line segment.<br>
Reversing the ordering of the vertices of either switches the subpolygon chosen.<br>
Reversing both has no affect because the two switches cancel.<br>
<br>
So I have to make a choice and live with it.  I want my choice to be<br>
consistent with<br>
any similar choice made in Squeak code.<br>
<br>
If none of the Squeak code depends on polygon vertices ordering then I<br>
would like<br>
to hear opinions on the matter so at least I can a decision that is at<br>
least better then<br>
arbitrary.<br>
<br>
Note that mathematics doesn't seem to help much here.  The shoelace algorithm<br>
for computing the area of a polygon and Green's theorem both use a<br>
counter-clockwise<br>
orientation.  However simple integration to determine the area under a<br>
curve implies<br>
a clockwise orientation (adding areas under each edge of the polygon when going<br>
left to right and subtracting when going right to left implied a<br>
clockwise orientation).<br>
<br>
Thanks<br>
<br>
Ralph Boland<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</blockquote></div>