Function polygonCentroid

  • Returns the centroid of the specified polygon.

    Parameters

    • polygon: [number, number][]

      Array of coordinates <x0, y0>, <x1, y1> and so on.

    Returns [number, number]