MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / Area

Function Area

TheForceEngine/TFE_Polygon/clipper.cpp:391–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389//------------------------------------------------------------------------------
390
391double Area(const Path &poly)
392{
393 int size = (int)poly.size();
394 if (size < 3) return 0;
395
396 double a = 0;
397 for (int i = 0, j = size -1; i < size; ++i)
398 {
399 a += ((double)poly[j].X + poly[i].X) * ((double)poly[j].Y - poly[i].Y);
400 j = i;
401 }
402 return -a * 0.5;
403}
404//------------------------------------------------------------------------------
405
406double Area(const OutPt *op)

Callers 5

removeDegeneratePathsFunction · 0.85
OrientationFunction · 0.85
FirstIsBottomPtFunction · 0.85
ExecuteInternalMethod · 0.85
JoinCommonEdgesMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected