Rotating a square with vertices at [itex](\pm \frac12 h, \pm \frac12h)[/itex] counterclockwise through an angle of [itex]\theta \in [\frac14 \pi, \frac34 \pi][/itex] about its centre [itex](0,0)[/itex] will move the vertex at [itex](\frac12h , \frac12 h)[/itex] to what you have as [itex](-|x|,c)[/itex]. This is a linear transformation, so we should have [itex]c = f(\theta)h[/itex] for some [itex]f(\theta)[/itex].
To calculate [itex](-|x|, c)[/itex], we can use a rotation matrix: [tex]
\begin{pmatrix} -|x| \\ c \end{pmatrix} = \begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{pmatrix} \begin{pmatrix} \tfrac12 h \\ \frac12 h \end{pmatrix}.[/tex] Hence [tex]
c = \tfrac12 h (\sin \theta + \cos \theta) = \frac{h}{\sqrt{2}} \cos\left(\theta - \frac\pi{4}\right).[/tex]