orrery
The Orrery is a virtual orrery initially built for worldbuilding purposes. It contains a quasi-accurate model of the solar system. Distance isn’t (yet) to scale and the positions of the celestial bodies are incorrect, but the orbital speeds and relative sizes are approximately correct. 1
usage
orrery
Create an Orrery with the any of the following options:
width | canvas width in pixels |
height | canvas height in pixels |
bg | canvas background colour |
fg | canvas foreground (stroke) colour |
model | a Model object to load into the Orrery |
model
A Model contains a collection of celestial objects (Bodies) to load into the Orrery. A Body can have the following attributes:
id | identifier |
tether | another optional Body to orbit around of |
r | radius |
v | orbital velocity |
or | orbital radius 2 |
rs | rotation speed |
const system = new Model()
const orrery = new Orrery({
width: 800,
height: 500,
bg: '#030303',
fg: '#e4e4e4',
model: system,
})
orrery.render()