Another approach is to consider how we can rotate point $(x_b, y_b)$ by angle $\theta$ (counterclockwise) around point $(x_c, y_c)$. Let the rotated point be $(x_a, y_a)$:
$$\left [ \begin{matrix} x_a \\ y_a \end{matrix} \right ] = \left [ \begin{matrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{matrix} \right ] \left [ \begin{matrix} x_b - x_c \\ y_b - y_c \end{matrix} \right ] + \left [ \begin{matrix} x_c \\ y_c \end{matrix} \right ] \tag{1}\label{G1}$$
The center matrix is the counterclockwise rotation around origin by angle $\theta$ in 2D. Because it rotates around origin, we move the center of rotation to origin, by subtracting the rotation center coordinates from the coordinates of the point we are rotating. After the rotation, we need to add back the coordinates we subtracted, to move the origin back to where it was originally.
In the original diagram, the center of rotation is at distance $r$ exactly above the center of the rectangle. If we choose the center of the rectangle before rotation and translation as the origin, then the center of rotation is
$$\left[ \begin{matrix} x_c \\ y_c \end{matrix} \right] = \left[ \begin{matrix} 0 \\ r \end{matrix} \right] \tag{2a}\label{G2a}$$
If we additionally choose $L$ as the lateral offset, we can move the rectangle right (positive $x$) before the rotation by that amount, and then do the rotation (noting that the center of rotation is not moved!), getting the correct position for the result. Thus, the point we are trying to rotate is
$$\left[ \begin{matrix} x_b \\ y_b \end{matrix} \right] = \left[ \begin{matrix} L \\ 0 \\ \end{matrix} \right] \tag{2b}\label{G2b}$$
Substituting $\eqref{G2a}$ and $\eqref{G2b}$ to $\eqref{G1}$ yields
$$\left[ \begin{matrix} x_a \\ y_a \end{matrix} \right] = \left[ \begin{matrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{matrix} \right] \left[ \begin{matrix} L \\ - r \end{matrix} \right] + \left[ \begin{matrix} 0 \\ r \end{matrix} \right] \tag{2c}\label{G2c}$$
If you are unfamiliar with matrix notation, the above is equivalent to
$$\left\lbrace \begin{aligned}
x_a &= L \cos\theta + r \sin\theta \\
y_a &= L \sin\theta - r \cos\theta + r \\
\end{aligned} \right. \tag{2d}\label{G2d}$$
In summary, the center of the rectangle moves by $(x_a, y_a)$ relative to its original position:
$$\left\lbrace \begin{aligned}
x_a &= L \cos\theta + r \sin\theta \\
y_a &= L \sin\theta + r (1 - \cos\theta) \\
\end{aligned} \right. \tag{3}\label{G3}$$
where $x$ increases right, $y$ up, and $\theta$ counterclockwise.