u(t) is called 60 times per second.
t: Elapsed time in seconds.
S: Shorthand for Math.sin.
C: Shorthand for Math.cos.
T: Shorthand for Math.tan.
R: Function that generates rgba-strings, usage ex.: R(255, 255, 255, 0.5)
c: A 1920x1080 canvas.
x: A 2D context for that canvas.
I understand that in this case, A and B are short methods used to obtain predictable (deterministic) results from a pseudo-random number generator (PRNG), unlike the Math.random() method.
A uses Math.sin to get values between -1 and 1, B just uses % and returns between 0 and 1. Both have some artifacts but are random enough for many things.
danny, you can't control the seed to Math.random() that makes it unusable for many applications. These do use dwitter defines but also can work just as well without, especially method B.
Warning: R=0.5; R=(R*9||.9)%1; // In this seed case (R=0.5), the result will always be 0.5 (it's fixed point, "a value that does not change under a given transformation").
u(t) is called 60 times per second.
t: elapsed time in seconds.
c: A 1920x1080 canvas.
x: A 2D context for that canvas.
S: Math.sin
C: Math.cos
T: Math.tan
R: Generates rgba-strings, ex.: R(255, 255, 255, 0.5)