function circular(center, radius, n, sphereRadius) {
  n = n ? n : 32;
  /** @type {Array<number>} */
  const flatCoordinates = [];
  for (let i = 0; i < n; ++i) {
    extend(
      flatCoordinates,
      sphereOffset(center, radius, (2 * Math.PI * i) / n, sphereRadius),
    );
  }
  flatCoordinates.push(flatCoordinates[0], flatCoordinates[1]);
  return new Polygon(flatCoordinates, 'XY', [flatCoordinates.length]);
}
Create an approximation of a circle on the surface of a sphere.
@param {import("../coordinate.js").Coordinate} center Center (`[lon, lat]` in degrees).
@param {number} radius The great-circle distance from the center to
    the polygon vertices in meters.
@param {number} [n] Optional number of vertices for the resulting
    polygon. Default is `32`.
@param {number} [sphereRadius] Optional radius for the sphere (defaults to
    the Earth's mean radius using the WGS84 ellipsoid).
@return {Polygon} The "circular" polygon.
@api