Planetarium Main Page

The DOGULEAN Planetarium 2.2

Space Traveler Edition

Technical Details

Source Code

See the planetarium github repository planetarium repository. (Currently, this code is rather old. It will be updated once the current code is cleaned up.)

Issues and Limitations

Methods and Background

A Planetarium or Star Map Implemented in WebGL and three.js

The idea of implementing a planetarium using a 3-D graphics system is an obvious one. We do it this way:

The model must be much the same as Kepler's model of the solar system, and the method of computing the positions of the planets is just a modernization of his in which the parameters change with time.

With WebGL, this can be done on a web page that anybody can access. With the three.js library, the 3-D part of the programming is relatively easy.


Most star data comes from the 2017 US Naval Observatory Table of Bright Stars.

We convert star magnitudes to brightness according to the formula in the Wikipedia Magnitude article. Converting the brightness number to screen values is a matter of judgement which depends on the value chosen for a reference brightness.

Star colors are derived from the B – V  color index of the star using a rough method derived from the table in a Cornell Ask an Astronomer answer. I would be happy to know a better way of doing it. The Bright Stars Table also contains the V - I  color index, so we could use a method that relies on both.

Most common names of stars come from the Wikipedia Proper Names of Stars article.


For planets other than the Sun (which is at the origin) and Moon, positions are computed from their Keplerian elements as given in Keplerian Elements for Approximate Positions of the Major Planets by E. M. Standish. Thanks to the miracle of the WebGL graphics engine, we only need to compute the heliocentric positions of the planets. The WebGL engine does the work of converting those to positions in the sky relative to the observer.

The main reason for computing planet positions instead of getting them from ephemerides is that we want positions in space rather than in the Earth's sky. A second is to avoid dependencies on other sites – the Planetarium is meant to run independently in a browser without needing an internet connection once it is loaded.

Although we do compute the right ascension and declination of planets to display in their tooltip description, we actually set their position in the solar system using their heliocentric ecliptic coordinates, then tilt the solar system by the J2000 obliquity of the Earth, then tilt the Earth back so that its north pole points to the celestial north pole.

The orbit of the Moon around the Earth is much more difficult to compute, because the Moon is subject to gravitational pull of both Earth and Sun, to the influence of the tides, and to much else. I have borrowed Javascript code to do this from Martin Vézina's Planet Positions project, which was itself translated from Matlab code by David Eagle, based in turn on programs in Lunar Tables and Programs From 4000 B.C. TO A.D. 8000  by Michelle Chapront-Touzé and Jean Chapront.

Data on radii, oblateness, and rotation rates of planets are taken from NASA planetary fact sheets.

Planet textures come from various sources.

I don't have any information about where longitude zero is for planets other than earth or how rotated they are at any given moment, so I have determined that arbitrarily. Longitude 0 is the left edge of the image I have used for the planet and I have used 0 as the rotation of the planet at the start of the J2000 Julian epoch.