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.
Arrow functions can be simplified, if you only have one argument you don't need parentheses, and if your result can be expressed as a a single line you don't need curly brackets and return
Since you are using the custom random function more than four times, you can go even further with the golf. You can use a trick where you override the valueOf on an object; normally, you need to create an object, but since you don't use the trigonometric function T, you can use it like this: T.valueOf=_=>400*Math.random() x.fillStyle=R(T,T,T) x.fillRect(960+S(T)*400,500+C(t*3)*T,1,5)
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)