top | item 42506145

T * sin (t)' ≈ Ornamented Christmas Tree (2013)

401 points| ryeguy_24 | 1 year ago |community.wolfram.com | reply

44 comments

order
[+] ryeguy_24|1 year ago|reply
Merry Christmas HN. Ever year, the original T * sin(t) Christmas tree gets posted. This year, I wanted to call out my favorite modification by Silvia Hao. It’s beautiful. One year, I’ll try to add to its beauty. But for now, I’ll just appreciate it. She posted it here: https://community.wolfram.com/groups/-/m/t/175891
[+] JadeNB|1 year ago|reply
I checked the post, but it's from someone who's far more comfortable with Mathematica than I am, so I hope you won't mind my asking about the maths.

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?

[+] Arnavion|1 year ago|reply
Silvia Hao's version is the one submitted here to HN, actually.
[+] jll29|1 year ago|reply
That's a beautiful animation (and useful maths ;-).

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...
[+] Lerc|1 year ago|reply
I made this Bauble dweet as a Christmas themed exercise in 2020 https://www.dwitter.net/d/20993

    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
[+] foobar1962|1 year ago|reply
My first time seeing it. Thanks for posting, and thanks to HN for being the kind of place that stuff like this gets posted.
[+] Alifatisk|1 year ago|reply
I think this would be perfect on openprocessing.org, I just don't know how to implement that.
[+] BobbyTables2|1 year ago|reply
Now make 30% of the bulbs randomly burn out :)
[+] hippich|1 year ago|reply
Randomly wouldn't be that bad. But whole segments - way more noticable!
[+] layer8|1 year ago|reply
Or a drill.
[+] block_dagger|1 year ago|reply
This is not a drill. It really is Christmas.