Given hand of $n$ number of rectangular cards of $w$ width and $h$ height. I want find the maximum width the hand takes after spreading the cards like the following:

- The first card is rotated counter clockwise along its center bottom by $\theta$ degrees
- The next card is shifted away from the previous card by $S$ units
- The card will also be rotated away (clockwise) from the previous card along its center bottom by $\beta$ degrees
- Each subsequent card will repeat step 2-3 until they are all spread.
Note: I realized while trying to solve this problem, the max width is not always from the top-left corner of the first card to the top-right corner of the last card.
Thank you so much to anyone kind enough to help me out.
Let $M$ be the center of bottom $AB$ of the first card, and $M_1$ its image under a translation of $S$ units along $AB$ (which is also the center bottom of the second card). We can then construct a point $O$ on the perpendicular bisector of $MM_1$ such that $\angle MOM_1=\beta$: the transformation carrying the first card to the second card is the single rotation of center $O$ and clockwise angle $\beta$.
It follows that the third card is the first card rotated about $O$ by $2\beta$ and so on. The $n$-th card, in particular, is obtained by rotating the first card about $O$ by $(n-1)\,\beta$.
This observation can help computing the position of the cards, but the problem is complicated because, as observed in the question, one must also take into account the intermediate cards. In practice, one should compute first of all the coordinates of vertices $ABCD$ of the first card and then those of vertices $A'B'C'D'$ of the last card, as well as the vertices corresponding to $C$ and $D$ of the intermediate cards. At that point one can find the leftmost and rightmost vertices, and compute the requested width.