Polygon Area 384fe2b4
Polygon area via the shoelace formula. Works for any simple polygon (convex or not), vertices in either winding order.
Time: O(n). tested
content/geometry/polygon-area.h
ld polygonArea(vector<Point> &poly) {
ld res = 0;
int n = (int)poly.size();
for (int i = 0; i < n; i++) res += poly[i].cross(poly[(i + 1) % n]);
return abs(res) / 2.0;
}