PolygonArea requires (last vertex) = (first vertex)

It is not obvious from the documentation that the function PolygonArea() only yields correct results if the last vertex coincides with the first one (a condition fulfilled by the example function estimatePi(), but not explicitly stated.)

In particular, for a given set of vertices (xwave,ywave) the value of PolygonArea(xwave,ywave) is not constant under cyclic permutation (e.g. operation Rotate).
doru wrote:
It is not obvious from the documentation that the function PolygonArea() only yields correct results if the last vertex coincides with the first one (a condition fulfilled by the example function estimatePi(), but not explicitly stated.)


The documentation states: "returns the area of a simple, closed, ..."

In order to have a "closed" contour you must have firstPoint=lastPoint.

A.G.
WaveMetrics, Inc.