Function GeodesicPolygonAccumulator.compute
Return the closed polygon's perimeter and signed area.
Use tryCompute instead when you prefer a bool failure result.
Computing includes the final edge back to the first corner and does
not change the stored polygon.
Example
Example computing a closed polygon with throwing failure semantics.
const solver =
Geodesic!double .fromEllipsoid(
Ellipsoid!double .sphere(
6_371_000.0));
auto accumulator =
GeodesicPolygonAccumulator!double .fromGeodesic(
solver);
accumulator .addPoint(
GeographicCoordinate!double .fromComponents(
Latitude!double .fromDegrees(0.0),
Longitude!double .fromDegrees(0.0)));
const result =
accumulator .compute();
assert(result .pointCount == 1);
assert(result .perimeter == 0.0);
assert(result .signedArea == 0.0);
}