Is there a general and easy way to calculate the new x and y coords of the rectangles in the big rectangle if I rotate the parent rectangle about 90deg. I know the x and y coords of each rectangle in the first picture and of course the width and height are also known.
In this case the origin appears to be on the upper left corner. Then following cofeemath ideas you can send every coordinate $(x,y)\to (y,-x+37)$ for a $90$ degree rotation.
$(x,y)\to (-x+37,-y+37)$ for a $180$ degree rotation
and $(x,y) \to (-y+37,x)$ for a $270$ degree rotation