Just swing your mouse around as the physics/math rotates the thingy around!
Calculation from Google, applied into scratch by ME don't mind the "oigs" which happens when the direction of the pendulum is 0