News for hackers. Stuff that matters.
Re:Shoelace formula by jguffey on Monday December 03, 2018 @01:47PM (#18591630)
For those who, like me, need to visualize such a method- I found an explainer: https://www.youtube.com/watch?v=0KjG8Pg6LGk
Re:Shoelace formula by travisjungroth on Monday December 03, 2018 @03:56PM (#18592889)
I worked at a company, HouseCanary, writing software for doing home appraisals. We used this formula to calculate the square footage of a home based on a computer drawing. The funny thing is that for an appraisal, you have to show your calculations. We thought showing the points and a shoelace formula whitepaper would be enough. It wasn't. So, my boss wrote code that dumps the whole calculation onto a pdf so someone who works in lending can say "that looks right".
Re:Shoelace formula by selimthegrim on Tuesday December 04, 2018 @12:56AM (#18596726)
Do you no longer work there for publically divulgable reasons?
Re:Shoelace formula by travisjungroth on Friday December 07, 2018 @03:50PM (#18631491)
I got a job as a software engineer at another company. Came with a title bump and raise.
Re:Shoelace formula by selimthegrim on Sunday December 09, 2018 @01:43PM (#18642447)
Glad to hear it. A friend who still works there as far as I know was singing their praises to me at a wedding a couple of years ago.
Re:Shoelace formula by anitil on Monday December 03, 2018 @06:01PM (#18594044)
Off-topic - does your company have any presence in Australia?
Re:Shoelace formula by travisjungroth on Friday December 07, 2018 @03:50PM (#18631482)
Nope
Re:Shoelace formula by giornogiovanna on Monday December 03, 2018 @02:30PM (#18592098)
If you rewrite this method in terms of determinants, then it also has the bonus of generalizing correctly to arbitrarily many dimensions! And it also gives you a nice picture - imagine adding and subtracting simplices with one point at the origin (triangles in 2D, tetrahedra in 3D).
Re:Shoelace formula by sleavey on Monday December 03, 2018 @03:45PM (#18592781)
Came here to ask about 3D. Weird that the article doesn't mention the 3D or n-dimensional case.
Re:Shoelace formula by phkahler on Monday December 03, 2018 @05:36PM (#18593852)
Here is my answer to 3D from a long long time ago.

https://stackoverflow.com/questions/1838401/general-formula-...

Another interesting thing about the metrix in that answer. If you invert it, the rows become the coefficients for the plane equations of the faces. You also don't need to fully invert it - IIRC the adjoint is sufficient.

Re:Shoelace formula by theoh on Monday December 03, 2018 @08:08PM (#18594889)
See Tom Duff's solution here: http://iq0.com/notes/normal.html
Re:Shoelace formula by chicob on Monday December 03, 2018 @03:56PM (#18592886)
I use this in measuring field areas. Like the text reads, this is Green's Theorem.

The area of a triangle ABC can be determined by doing the cross product of any of the vectors that are the translation from a vertex to another (e.g. AB⨯AC = |AB|.|AC|.sin{^BAC}). More rigorously, this is the area of a lozenge, which then has to be divided by two.

Imagining a point X inside a convex polygon, it is easy to see a set of triangles with vertex X in common.

In fact, the polygon can not only be concave but point X can be outside the polygon, since the sine will compensate for negative and positive angles, subtracting any weird triangle out of the sum in the end.

Computationally, the point X should be as close as possible to every vertex, so that rounding errors are minimized.