{"by":"captainnemo729","descendants":34,"id":46742285,"kids":[46743827,46743701,46742699,46742560,46742867,46742694,46742789,46742814,46742758,46742915,46743619,46743020,46743707,46742320],"score":54,"text":"I built this because measuring my age in years felt boring—I wanted to see the kilometers.<p>The first version only used Earth&#x27;s orbital speed (~30km&#x2F;s), but the number moved too slowly. To get the &quot;existential dread&quot; feeling, I switched to using the Milky Way&#x27;s velocity relative to the CMB (~600km&#x2F;s). The math takes some liberties (using scalar sum instead of vector) to make the speed feel &quot;fast,&quot; but it gets the point across.<p>Under the hood, it&#x27;s a single HTML file with zero dependencies. No React, no build step. The main challenge was the canvas starfield—I had to pre-allocate the star objects to stop the garbage collector from causing stutters on mobile.<p>Let me know if the physics makes you angry or if the stars run smooth on your device.","time":1769248544,"title":"Show HN: I built a space travel calculator using Vanilla JavaScript","type":"story","url":"https://cosmic-odometer.vercel.app/"}