-
-
Save macressler/4c733ad10f1bc4f1ce06 to your computer and use it in GitHub Desktop.
Solar system tour at speed of light
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Experience our solar system at the speed of light (it's not as exciting as it sounds) | |
Step 1) Visit http://joshworth.com/dev/pixelspace/pixelspace_solarsystem.html. | |
Step 2) Open the JS console and paste in the following code. | |
Step 3) Watch the solar system "fly" by (BTW it'll take more than 5 hours to get to Pluto) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var c = 299792458; var w = 3474800; var cw = c / w * 0.001; var running = true; var t1 = new Date(); var x = 0; function scrollAtC(t0) { t1 = new Date(); x = window.scrollX + (t1 - t0) * cw; window.scrollTo(x, 0); if (running) { setTimeout(function() { scrollAtC(t1) }, 17) } }; scrollAtC(new Date()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment