First, the T vs. t in T * sin(t) doesn't mean anything, right? Second, the ' in the title T * sin(t)' doesn't belong, right?
Then I think that this is graphing essentially (t * sin(t), t * cos(t), t + something), which is a cone if the something is constant, which I believe it is—and that certainly matches the graph. And the rest is about choosing an aesthetically pleasing step size and accomplishing the lovely twinkling and colors, right?
Looks like it was written in C++
In the spirit of minimalism, Merry Christmas to all HNers with this little but time-tested command:
$ xmastree 5 9 2024`
*
***
*****
*******
*
***
*****
*******
*
***
*****
*******
*
***
*****
*******
***
***
***
***
Source: https://github.com/jochenleidner/ltools/blob/main/src/bin/xm... function u(t) {
t||(c.width/=6) // shrink canvas to 1/6 at t==0
M=a=>x.filter=a?"none":"blur(1px)brightness(90%"
M();x.drawImage(c,0,0)
for(i=n=90;--i;)
x.fillRect(
160-S(X=i+t*4)*(1-(v=C(i*n))*v)*n,
v*n+n,
4,
2,
x.fillStyle="#F"+(i+10),M(C(X)<0))
}
with
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