Get rotated bounding points for rectangle

Hello, I am wondering if it’s possible to get the rotated corner coordinates for a Rectangle.

Use case: I’m plotting shape control points on the corners of the Rectangles to give my users drag and drop resizing.

It works great with no rotation, but I’m having trouble calculating the rotated corner positions; I’m off by a visible margin. Any tips would be greatly appreciated