Rolling Square

Description

The square rolls around the inside of the box. To calculate the coordinates of the center of the square, the bottom side uses x = x + 10/9 and y = 350 - (|sin(θ*2)| * (50 * √(2) - 50)). The other sides use a variation of this equation. Click anywhere on the grid then press the space bar to go into fullscreen.

Code