x +
        Math.floor(
          dimension / 2 -
          Math.abs(width * cos / 2) -
          Math.abs(height * sin / 2)