# Making an application to draw the night sky of other planets

I'm making an application for drawing a night sky of planets other than Earth. Ultimately my app may be used to draw a night skies of a hypothetical planets in other solar systems. I'm doing it because I found a lack of such software and also out of curiosity :).

The problem I stood upon is orientating the stars based on astronomical data user provides. I assumed all I need to properly orient them are below parameters:

• Axial tilt
• Longitude of ascending node
• Inclination
• Ascending node of the planet's equator

I's specifically looking for a star positions data source that has got these properties:

• The X axis points at the Earth's vernal equinox point,
• and the Z axis points at the celestial north pole

Having all above my app does a series of rotations on the star data. The algorithm is:

1. nivelate the Earth's axial tilt by rotating around X axis by 23°
2. make an A vector by rotating a vector pointing at +X axis around +Z axis by the planet's "Equator asc. node"
3. rotate around the A vector by the planet's axial tilt
4. make a B vector by rotating a vector pointing at (new) +X axis by the planet's "Long. of asc. node"
5. rotate around the B vector by the planet's Inclination

I made some assumptions in the above algorithm:

• All target planet's orbital data are taken relative to the Earth orbit,
• Earth's parameters except axial tilt are equal to 0

My application works...in a way. Here is what I get when I put the Uranus' orbital parameters:

According to the Wikipedia Uranus' north star is 35Eta Oph which on my result is below the center.

One might say I got "close enough", but I'm not happy with the results. I believe I made some error either in my algorithm, or forgot some other important parameter. I know there are applications like Stellarium that one can set to show a night sky of other planets in the solar system, but my quick glide over Stellarium's source code tells me the app has got the locations of solar system's planets north pole hardcoded.

So, my question is: Is there any flaw in my algorithm or in my reasoning, that makes my program produce incorrect results?

PS:
If one is interested, there is my app: https://github.com/felix-leg/ExPlanetNightSkyGenerator

• You may want to checkout the source code of Stellarium regardless. You might be able to extend that to allow re-positioning onto extrasolar planets assuming you manage to get the 3D info for all the stars. If the other planets North poles is hard coded (as you write)... you might be able to extend or modify the source and make that a configurable property. Mar 7, 2022 at 16:35
• It's not clear how big of an error we're looking at. One thing is you're using $23^{\circ}$ when you should be using $23.436547213^{\circ}$. That will account for $.43^{\circ}...$ of your error. Mar 7, 2022 at 22:23
• What exactly makes you not happy with your results? What is your criterion for success and how can I judge what you show by that? Mar 8, 2022 at 1:36
• @GregMiller sorry I haven't yet put all features I wanted in my app. Yes, I'm internally using the more precise value for Earth's axial tilt. And the error is about 18° off the center. The border of the map is 0° declination. Mar 8, 2022 at 13:55
• @planetmaker well right now I want my app to make rotations right. Probably I could let the users of my app to enter their coordinates of north pole by hand, but I also want to have the possibility to enter the orbit and find out what a north pole I get as a result. As for Stellarium: If I guess right their source of data are IAU papers, so I want to know what IAU does when they calculate north poles of the planets. Mar 8, 2022 at 14:02

All right I found where lies the problem. I made a (very) silly mistake.

TL;DR — double check you test data

## Uranus

According to the Wikipedia Uranus' axial tilt is 97.77° and its north star is 35Eta Oph. However I've found a webpage which states the axial tilt of ~97° is outdated and should be equal to about 82°. No, the planet didn't suddenly "flipped over", it is the IAU's definition of the planet's north pole that has been changed.

In other words on Wikipedia (and some other encyclopedias too) half of data comes from before the IAU's redefinition and other half from after it.

With the new data my app produces this result:

So, my app was working right all the time, it's the test data that's wrong.

## Mercury

I haven't wrote it in the original post, but I also tested my app with Mercury. The error was smaller, yet still significant as 47Omi Dra also didn't wanted to "jump in" the right coordinates. It was like that until...I added minus sign to the axial tilt value of 7.005°.

## Celestia

Dave Gremlin mentioned another app called Celestia. I'm familiar with this program so much, that I in fact got some of test data from Celestia's configuration files.

However I haven't spot one thing: for example the entry for Mercury is:

CustomOrbit "vsop87-mercury"

# Overridden by CustomOrbit
# EllipticalOrbit {
#    Period            0.2408
#    SemiMajorAxis     0.3871
#    Eccentricity      0.2056
#    Inclination       7.0049
#    AscendingNode    48.33167
#    LongOfPericenter 77.456
#    MeanLongitude   252.251
# }


Long story short, in this configuration there are two sources of data that the Celestia uses. One of it, at the top, is what Celestia uses now: a hardcoded in the app vsop87-mercury. The other one is the commented out text block below. Probably during the developing of Celestia the app used at first that text block (then not in comments), but at some point in time the developers switched to the hardcoded one.

It didn't occurred to me that the block may contain very old data and was kept in the configuration file for a very long time. And thus, I shouldn't trust that data anymore.

Celestia has been for a very long time and has got a long road of developing behind it. Unfortunately lately there is not much going on with this app, which means updates for it may be sparse.

## Conclusion

I should make the test data based on what IAU uses for calculating the north poles of the solar system's planet. In my defense I can say that it is very hard to find it, as as soon I put "IAU" in the search bar, Google starts to think I'm looking for Pluto only :(