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.
GPT3 with the prompt: I wrote a dwitter.net "dwit" (a 140 character js program that shows pretty graphics) to draw a rotating unicorn horn for my friend's birthday. First, let me explain step by step how it works: To remind ourselves of the dwitter API, lets take a look at the default dweet code: c.width=1920 // clear the canvas for(i=0;i<9;i++) x.fillRect(400+i*100+S(t)*300,400,50,200) // draw 50x200 rects Now lets decompose what we intend to draw. A unicorn horn looks like
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)