tomxor 4 days ago

You mean technically? I should have posted the beta dwitter link which has the "compress" toggle, because most dweets are unicode packed. https://beta.dwitter.net/d/26521

Here's the js anyway:

  for(i=10;i--;x.fillStyle=R(i-8||255),x.beginPath(x.fill()))x.arc(960+[45,29,14,8,2,1.5,1,.6,0,0][i]*1e5*S(t/5e3/[165,84,29,12,2,1,.6,.2,1,1][i]),540,[24,25,58,69,3.4,6.4,6,2.4,696,2e3][i],0,7)
This one is actually relatively simple to explain, it loops over the 10 planets (i), and draws a circle for each, with the position and size all being defined in the x.arc method. Planets are differentiated by the arrays of values selected by [i]. The X position is calculated as the orbital distance multiplied by the sine of time / orbital period... d x sin(t/p). But d and p are substituted for the value for each planet using the arrays [1,2,3][i].

Surprisingly the precision used in those encoded values is enough at 1000km per pixel (I checked).

  • ByThyGrace 4 days ago

    I presume including Pluto's parameters in the array is both a rebellious statement and a brag. ("Yes, my JS snippet could have been even shorter if you asked the IAU.")

    • tomxor 4 days ago

      Actually I couldn't fit Pluto, I sacrificed everything I could, but to fit it would require sacrificing the precision of Mars, Earth and Mercury (dropping the decimal), but I wanted to maintain enough precision to be able to tell them apart by size (which you just about can at full screen due to antialiasing)... Otherwise I definitely would have included it for that very sentiment ;)

      The reason there are 10 radi is for 8 planets + sun + drawing the black backdrop (2e3): [24,25,58,69,3.4,6.4,6,2.4,696,2e3]