I'm programming a game. Part of the game involves a spinning rectangle, so I'd like to keep track of two points on that rectangle. The center, and the bottom right corner of it.
I want to draw a sine wave of the relative vertical distance between, the center and the corner.
At 0, the distance is -16.
At $\frac{\pi}{2}$, the distance is 32
At $\pi$, the distance is 16
At $\frac{3\pi}{2}$, the distance is -32
At $2\pi$, this distance is -16
This isn't like to periodic functions I studied in school, where the distance between $f(0)$ and $f(\frac{\pi}{2})$ is the same as the distance between $f(\frac{\pi}{2})$ and $f(\pi)$, etc.
I'm having trouble figuring out the equation of this function.
Would appreciate any help.

Your corner has the initial coordinates $$\pmatrix{x_0\\y_0} = \pmatrix{32\\-16}.$$ In order to get the new coordinates, you have to apply the rotation, which can be expressed in terms of a matrix-vector multiplication: $$ \pmatrix{x\\y} = \pmatrix{\cos\varphi & -\sin\varphi \\ \sin\varphi & \cos\varphi} \pmatrix{x_0\\y_0} $$ So your $y$ can be calculated as $$ y=32\sin\varphi -16\cos\varphi $$ If you want to have only one trigonometric function, this can be written as $$ y=16\sqrt{5}\sin(\varphi-\varphi_0)\;\;\mbox{with}\;\; \varphi_0=\arctan\left(\frac{1}{2}\right) $$