float tempX = x - cx;
float tempY = y - cy;
float rotatedX = tempX*cos(theta) - tempY*sin(theta);
float rotatedY = tempX*sin(theta) + tempY*cos(theta);
x = rotatedX + cx;
y = rotatedY + cy;
Finding the center might be the hard part though, if it's not a rectangle.