TITLE: What function could describe this GIF animation?
QUESTION [13 upvotes]: I found this image on Beautiful Mathematical GIFs Will Mesmerize You and this GIF really caught my attention. From what I see, it's a 2D circle morphing into the 3D sphere. What function could describe this GIF animation? All comments are appreciated.
z < 0 -> red
z > 0 -> green
z = 0 -> blue

REPLY [3 votes]: The source code shows it: in spherical coordinates, $\phi=t_w\cos(\theta)$ where $t_w$ changes periodically over time between $0$ and $1$ (as a third degree polynomial of the cosine). The "sphere" also rotates uniformly and is displayed with perspective.