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.
