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.
Here is a golfing tip: use arrow functions and shave off a few bytes r=(a=255)=>a*Math.random();x.fillStyle=R(r(),r(),r());c.onmousemove=e=>x.fillRect(e.x*c.width/569,e.y*c.height/320,r(100),r(100))
if you want to make some compromises, you could make your random function always return 255 like this: <r=a=>266*Math.random();x.fillStyle=R(r(),r(),r());c.onmousemove=e=>x.fillRect(e.x*c.width/569,e.y*c.height/320,r(),r())
Thanks for all the suggestions! Never really used arrow functions before, already used them in new one! Thanks a lot!
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)