doubled the frame rate from ca. 2 FPS to 4 FPS by reworking sine and cosine