Comment by darajava
Incredible - how does this work?
Incredible - how does this work?
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.")
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]
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:
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).