public final Rectangle getBoundingRectangle() {
        double rotmc1x = Math.cos(rotation);
        double rotmc1y = Math.sin(rotation);
        double rotmc2x = -rotmc1y;
        double rotmc2y = rotmc1x;

        double hx = width * 0.5;
        double hy = height * 0.5;

        double leftBound = 0;
        double rightBound = 0;
        double topBound = 0;
        double bottomBound = 0;

        for (int xSign = -1; xSign <= 1; xSign += 2) {
            for (int ySign = -1; ySign <= 1; ySign += 2) {
                double xPos = rotmc1x * hx * xSign + rotmc2x * hy * ySign;
                double yPos = rotmc1y * hx * xSign + rotmc2y * hy * ySign;

                if (xPos < leftBound) {
                    leftBound = xPos;
                } else if (xPos > rightBound) {
                    rightBound = xPos;
                }
                if (yPos < bottomBound) {
                    bottomBound = yPos;
                } else if (yPos > topBound) {
                    topBound = yPos;
                }
            }
        }
        return new Rectangle((int) (x+leftBound), (int) (y+bottomBound), 
                (int) (rightBound-leftBound), (int) (topBound-bottomBound));
    }