polygonCenter method

Point polygonCenter(
  1. Polygon polygon
)
override

Get polygon geometric center polygon polygon object for calculation Polygon Returns center point Point

Example:

// Calculate polygon center
Point center = GeometryUtils.polygonCenter(polygon);
print("Polygon center: (${center.x.toStringAsFixed(2)}, ${center.y.toStringAsFixed(2)})");

Implementation

Point polygonCenter(Polygon polygon) {
    final _polygonCenterFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        PointNative Function(PolygonNative),
        PointNative Function(PolygonNative)
      >('navigine_sdk_flutter_GeometryUtils_polygonCenter__Polygon'));
    final __resultHandle = _polygonCenterFfi(PolygonImpl.toNative(polygon));
    final _result = PointImpl.fromNative(__resultHandle);
    return _result;
}