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:
- 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.
- xxxrot - an object linked to xxxaxe which will cause the planet to rotate (orbit) along xxxaxe by the degrees specified in the tables.
- 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”.
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.