function calculateCenterOn(coordinate, size, position, resolution, rotation) {
  // calculate rotated position
  const cosAngle = Math.cos(-rotation);
  let sinAngle = Math.sin(-rotation);
  let rotX = coordinate[0] * cosAngle - coordinate[1] * sinAngle;
  let rotY = coordinate[1] * cosAngle + coordinate[0] * sinAngle;
  rotX += (size[0] / 2 - position[0]) * resolution;
  rotY += (position[1] - size[1] / 2) * resolution;

  // go back to original angle
  sinAngle = -sinAngle; // go back to original rotation
  const centerX = rotX * cosAngle - rotY * sinAngle;
  const centerY = rotY * cosAngle + rotX * sinAngle;

  return [centerX, centerY];
}
@param {import("./coordinate.js").Coordinate} coordinate Coordinate.
@param {import("./size.js").Size} size Box pixel size.
@param {import("./pixel.js").Pixel} position Position on the view to center on.
@param {number} resolution Resolution.
@param {number} rotation Rotation.
@return {import("./coordinate.js").Coordinate} Shifted center.