Calculates the centroid of a set of points Undefined values are skipped over.

// Find centroid of a list of points
const c1 = centroid(p1, p2, p3, ...);

// Find centroid of an array of points
const c2 = centroid(...pointsArray);
  • Parameters

    • Rest...points: readonly (undefined | Point)[]

    Returns Point

    A single point