How did the programmer know if he is going to use Sin or Cos?
In this case it wouldn't matter indeed but the idea here is to output a value that continually oscillates between 0 and 1 smoothly.
Both sin & cos do this but dephased by 90°
The question a programmer would've asked himself here is "what function will perpetually output values that oscillate between 0 & 1 and back down like this:
Oops it's Saturday morning: I mean -1 & 1, not 0 & 1