Simple Demo Showing Orbits of Inner Planets

Here is a simple program which shows the orbits of the inner planets.

To create the elliptical orbits, this program uses look-up tables generated from formulae described in V Ramanakumar, “Mathematically Describing Planetary Orbits in Two Dimensions”, Journal of Applied & Computational Mathematics.

The orbits for each planet include several linked objects:

  1. xxxaxe - an object centered at the sun which is tilted by the inclination of the orbit and rotated so that the maximum vertical distance occurs at the correct longitude.
  2. xxxrot - an object linked to xxxaxe which will cause the planet to rotate (orbit) along xxxaxe by the degrees specified in the tables.
  3. xxxpos - the planet object linked to xxxrot which is the distance from the center specified in the tables.

The orbit lines are drawn using a separate line drawing routine which uses rotation and distance from the tables. Some adjustments were required because the line drawing routine uses a slightly different reference system than the reference system which applies to objects.

This is not to scale since the size of the planets is exaggerated for effect.

The reference system I use treats the direction of the sun from earth at the winter solstice as North - since it is part of a larger program that shows events for a full year - from Dec 21, 2020 to Dec 21, 2021. However, the normal reference system treats the direction of the sun from earth at the vernal equinox (March 21) as North. If you want to use that system, you will want to shift the table values by 90 degrees. The simulation begins with the camera pointed in that direction, designated “Spring”.

ADDITION
I have added a zip file that includes the program, the orbit data file, textures, style (which seems to display well on Apple devices) and a sample Excel worksheet used to compute the orbit data for Mercury. The file for the Milky Way background was obtained from the NASA website.

3 Likes

Looks quite nice, I appreciate you’re using low-res textures where for things that appear very small on the screen. Nice optimization!

Thanks. I started with larger more detailed files, but realized that the planets (except for Mercury) would be spinning like mad, so I shrunk them down to 32x16 blurry versions of the originals - just enough to give them a hint of the proper color.

1 Like