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.
can you see how this circle method works? there is an array with 4 elements, the first 2 being positions (x,y), and the last 2 being analogous to a vector (in physics) with magnitude and direction, or simply (velocity-x, velocity-y). The velocity vector is added to the position coordinates once per frame and is itself adjusted in a way to create a perfectly circular "orbit" about the origin. Interestingly, this approach can be extended into 3 or more dimensions, and involve, obviously, more than 2 bodies. 3-body orbital chaos can be very interesting and beautiful, e.g. https://code.dweet.net/full/2w8z
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)