Animated cosine using Raphaël—JavaScript Vector Library