get rotated box size

i have tried anything but my math is suck so i can’t figure out how to do this.
i have a box that have X, Y, X2, Y2 and rotation.
i trying to get the size outside the box when its rotated.
like this…

any ideas ?

It’s simply the min/max of the rotated/translated vertices.

When rotation is CW, take pair of left up and right buttom points.
When rotation is CCW, take pair of left buttom and right up points.
That pairs, have new position when rotated, which can be calculated by trigonometry. Then calculated their distance.