function getInteriorPointsOfMultiArray(
  flatCoordinates,
  offset,
  endss,
  stride,
  flatCenters,
) {
  /** @type {Array<number>} */
  let interiorPoints = [];
  for (let i = 0, ii = endss.length; i < ii; ++i) {
    const ends = endss[i];
    interiorPoints = getInteriorPointOfArray(
      flatCoordinates,
      offset,
      ends,
      stride,
      flatCenters,
      2 * i,
      interiorPoints,
    );
    offset = ends[ends.length - 1];
  }
  return interiorPoints;
}
@param {Array<number>} flatCoordinates Flat coordinates.
@param {number} offset Offset.
@param {Array<Array<number>>} endss Endss.
@param {number} stride Stride.
@param {Array<number>} flatCenters Flat centers.
@return {Array<number>} Interior points as XYM coordinates, where M is the
length of the horizontal intersection that the point belongs to.