Centroid (center of mass) of a simple polygon with uniform density.
pts (ndarray) – (N,2) array of vertices in order (first need not repeat at end).
(2,) centroid array. (If degenerate area, returns vertex mean.)
ndarray
Compute the area and perimeter for a Counter-ClockWise (CCW) polygon.
pts (ndarray) – (N,2) array of vertices in CCW order (first need not repeat at end).
A tuple of (area, perimeter).
tuple[float, float]
Resample an open polyline to M points with uniform arclength spacing. Keeps endpoints exactly. If M is None, uses original number of points.
pts (ndarray) – (N,2) array of polyline vertices.
M (int | None) – Number of output points; if None, uses N.
(M,2) array of resampled polyline vertices.