News for hackers. Stuff that matters.
Re:Shoelace Formula by silentvoice on Friday December 26, 2014 @01:34PM (#8799628)
Very handy formula. I was recently in the situation of being given a bunch of polygons, each represented in a list-of-edges format and I needed to compute the outward-pointing normals for the edges. It's relatively straightforward to translate list-of-edges into list-of-vertices, but not so straightforward (to me) to ensure that the vertices are in counterclockwise order after this translation.

If you take the shoelace formula and remove the absolute value then you still get the correct area up to floating point errors, just there may be a minus sign in front of it. If there is a minus sign, reverse the order of your vertices and boom you have counterclockwise order. Computing the normals after this is routine.

Re:Shoelace Formula by robinhoodexe on Friday December 26, 2014 @01:09PM (#8799541)
Sort of unrelated: reading Wikipedias mobile pages on a "standard" (15" in my case) screen is actually rather nice. Very clean look.
Re:Shoelace Formula by percept on Friday December 26, 2014 @02:02PM (#8799791)
Oh, that is nice--think I'll start heading there by default (https://en.m.wikipedia.org/wiki/Main_Page).