Just watch, and change the variable "mode" to see what happened. It may look the same but its different look inside all the sines are now cosines.