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

Function Area

renderers/agg/src/clipper.cpp:89–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87//------------------------------------------------------------------------------
88
89double Area(const Polygon &poly)
90{
91 int highI = poly.size() -1;
92 if (highI < 2) return 0;
93 double a;
94 a = static_cast<double>(poly[highI].X) * static_cast<double>(poly[0].Y) -
95 static_cast<double>(poly[0].X) * static_cast<double>(poly[highI].Y);
96 for (int i = 0; i < highI; ++i)
97 a += static_cast<double>(poly[i].X) * static_cast<double>(poly[i+1].Y) -
98 static_cast<double>(poly[i+1].X) * static_cast<double>(poly[i].Y);
99 return a/2;
100}
101//------------------------------------------------------------------------------
102
103bool PointIsVertex(const IntPoint &pt, PolyPt *pp)

Callers 1

OffsetPolygonsFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected