function transform2D(
  flatCoordinates,
  offset,
  end,
  stride,
  transform,
  dest,
  destinationStride,
) {
  dest = dest ? dest : [];
  destinationStride = destinationStride ? destinationStride : 2;
  let i = 0;
  for (let j = offset; j < end; j += stride) {
    const x = flatCoordinates[j];
    const y = flatCoordinates[j + 1];
    dest[i++] = transform[0] * x + transform[2] * y + transform[4];
    dest[i++] = transform[1] * x + transform[3] * y + transform[5];

    for (let k = 2; k < destinationStride; k++) {
      dest[i++] = flatCoordinates[j + k];
    }
  }

  if (dest && dest.length != i) {
    dest.length = i;
  }
  return dest;
}
@param {Array<number>} flatCoordinates Flat coordinates.
@param {number} offset Offset.
@param {number} end End.
@param {number} stride Stride.
@param {import("../../transform.js").Transform} transform Transform.
@param {Array<number>} [dest] Destination.
@param {number} [destinationStride] Stride of destination coordinates; if unspecified, assumed to be 2.
@return {Array<number>} Transformed coordinates.