jsOrrery is a Solar System / orbital mechanics simulation, or orrery, that I wrote in WebGL and Javascript. The main feature of jsOrrery is that the planets positions are accurate in regards to the date you set, and it has the consequence that you can observe things that happen in the real Solar System.
See the project live at [orrery.com] (http://orrery.com). Thanks to [@neave] (https://twitter.com/neave) for the domain :)
The directory named dist
contains the built app. The html file is an example of jsOrrery placed in a page. Basically, you link jsOrrery's js and css files in your HTML file and call the app.
As soon as jsOrrery is loaded, it calls a function window.onJsOrreryLoaded
if it exists, with JSOrrery class as param. JSOrrery is also accessible through the global window.jsOrrery
variable. To init the app, you just create a new instance.
const jsOrrery = new JSOrrery();
If you want to customize how jsOrrery behaves, you can pass a config object to its init method.
You can also use webpack to display the app in a local environment with npm start
, which will then make the orrery available at http://localhost:2018. To build the js, you can run webpack directly in the terminal, for example env NODE_ENV=production webpack
.
- Planets orbital elements were taken from Nasa's Jet Propulsion Laboratory.
- I learned about calculating positions from orbital elements by reading these documents by Keith Burnett, Paul Schlyter and E M Standish (JPL).
- Planet texture maps are a courtesy of James Hastings-Trew.
- Stars coordinates from AstroNexus and Nasa.
- David Eagle for basic orbital calculations of the Moon, based on "Lunar Tables and Programs From 4000 B.C. TO A.D. 8000" by Michelle Chapront-Touze and Jean Chapront (Bureau des Longitudes). See mathworks.com.
- Precise lunar positions from ELP2000-85 theory by Michelle Chapront-Touze and Jean Chapront (Bureau des Longitudes). Javascript code ported from Fortran example found at http://vizier.cfa.harvard.edu/viz-bin/ftp-index?VI/79.
- Earth precise position from VSOP87, Bretagnon P., Francou G., (Bureau des Longitudes), from examples found at https://www.caglow.com
- Nasa/JPL's HORIZONS was used extensively to test my results. https://ssd.jpl.nasa.gov/horizons.cgi
- Delta T computations from Nasa's eclipse website https://eclipse.gsfc.nasa.gov/SEcat5/deltatpoly.html
- Bob Braeunig for calculations of Apollo missions free return trajectories.
- Quadratic integrations from http://orbit.medphys.ucl.ac.uk/'s documentaion by Martin Schweiger.
- Some techniques are inspired by Michael Chang's tutorial of 100,000 stars
- And of course, many thanks to Mr Doob for the excellent three.js
More details on La Grange's blog at http://lab.la-grange.ca/en/jsorrery