Draw a cosine wave in the square animation.