MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / polygon_area

Function polygon_area

code/geometry/polygon.cpp:7–8  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5 rep(i,1,cnt-1) area += cross(p[i] - p[0], p[i + 1] - p[0]);
6 return area / 2; }
7double polygon_area(polygon p) {
8 return abs(polygon_area_signed(p)); }
9#define CHK(f,a,b,c) \
10 (f(a) < f(b) && f(b) <= f(c) && ccw(a,c,b) < 0)
11int point_in_polygon(polygon p, point q) {

Callers 1

testFunction · 0.85

Calls 1

polygon_area_signedFunction · 0.85

Tested by 1

testFunction · 0.68