<p>All right I found where lies the problem. I made a (very) silly mistake.</p>
<p><strong>TL;DR — double check you test data</strong></p>
<h2>Uranus</h2>
<p>According to the Wikipedia Uranus' axial tilt is 97.77° and its north star is <code>35Eta Oph</code>. However I've found <a href="https://skyandtelescope.org/astronomy-resources/astronomy-questions-answers/why-dont-we-say-it-has-a-direct-spin-with-the-axis-tilted-82176-instead-of-98176/" rel="nofollow noreferrer">a webpage</a> which states the axial tilt of ~97° is <em>outdated</em> and should be equal to about 82°. No, the planet didn't suddenly &quot;flipped over&quot;, it is the IAU's definition of the planet's north pole that has been changed.</p>
<p>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.</p>
<p>With the new data my app produces this result:</p>
<p><a href="https://i.sstatic.net/HLDxf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HLDxf.png" alt="new Uranus north pole" /></a></p>
<p>So, my app was working <em>right all the time</em>, it's the test data that's <em>wrong</em>.</p>
<h2>Mercury</h2>
<p>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 <code>47Omi Dra</code> also didn't wanted to &quot;jump in&quot; the right coordinates. It was like that until...I added <em>minus sign</em> to the axial tilt value of 7.005°.</p>
<h2>Celestia</h2>
<p>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.</p>
<p>However I haven't spot one thing: for example the entry for Mercury is:</p>
<pre><code>CustomOrbit &quot;vsop87-mercury&quot;

# 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
# }
</code></pre>
<p>Long story short, in this configuration there are <em>two</em> sources of data that the Celestia uses. One of it, at the top, is what Celestia uses now: a hardcoded in the app <code>vsop87-mercury</code>. 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.</p>
<p>It didn't occurred to me that the block may contain <em>very old data</em> and was kept in the configuration file for a very long time. And thus, I shouldn't trust that data anymore.</p>
<p>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.</p>
<h2>Conclusion</h2>
<p>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 <em>very hard</em> to find it, as as soon I put &quot;IAU&quot; in the search bar, Google starts to think I'm looking for Pluto only :(</p>

CC BY-SA 4.0
2022-03-11T10:41:24.940Z
2022-03-11T10:41:24.940Z
Felix.leg
<p>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 :).</p>
<p>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:</p>
<ul>
<li>Axial tilt</li>
<li>Longitude of ascending node</li>
<li>Inclination</li>
<li>Ascending node of the planet's equator</li>
</ul>
<p>I's specifically looking for a star positions data source that has got these properties:</p>
<ul>
<li>The X axis points at the Earth's vernal equinox point,</li>
<li>and the Z axis points at the celestial north pole</li>
</ul>
<p>Having all above my app does a series of rotations on the star data. The algorithm is:</p>
<ol>
<li>nivelate the Earth's axial tilt by rotating around X axis by 23°</li>
<li>make an <strong>A</strong> vector by rotating a vector pointing at +X axis around +Z axis by the planet's &quot;Equator asc. node&quot;</li>
<li>rotate around the <strong>A</strong> vector by the planet's axial tilt</li>
<li>make a <strong>B</strong> vector by rotating a vector pointing at (new) +X axis by the planet's &quot;Long. of asc. node&quot;</li>
<li>rotate around the <strong>B</strong> vector by the planet's Inclination</li>
</ol>
<p><a href="https://i.sstatic.net/LsAYz.gif" rel="noreferrer"><img src="https://i.sstatic.net/LsAYz.gif" alt="an animation of the rotations" /></a></p>
<p>I made some assumptions in the above algorithm:</p>
<ul>
<li>All target planet's orbital data are taken relative to the Earth orbit,</li>
<li>Earth's parameters except axial tilt are equal to 0</li>
</ul>
<p>My application works...in a way. Here is what I get when I put the Uranus' orbital parameters:</p>
<p><a href="https://i.sstatic.net/KtIt1.png" rel="noreferrer"><img src="https://i.sstatic.net/KtIt1.png" alt="Uranus night sky" /></a></p>
<p>According to the Wikipedia Uranus' north star is <code>35Eta Oph</code> which on my result is below the center.</p>
<p>One might say I got &quot;close enough&quot;, 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.</p>
<p>So, my question is: <strong>Is there any flaw in my algorithm or in my reasoning, that makes my program produce incorrect results?</strong></p>
<p>PS:<br />
If one is interested, there is my app: <a href="https://github.com/felix-leg/ExPlanetNightSkyGenerator" rel="noreferrer">https://github.com/felix-leg/ExPlanetNightSkyGenerator</a></p>

CC BY-SA 4.0
2022-03-07T16:35:12.510Z
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.
planetmaker
CC BY-SA 4.0
2022-03-07T22:23:45.627Z
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.
Greg Miller
CC BY-SA 4.0
2022-03-08T01:36:14.523Z
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?
planetmaker
CC BY-SA 4.0
2022-03-08T13:55:20.013Z
@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.
Felix.leg
CC BY-SA 4.0
2022-03-08T14:02:58.333Z
@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.
Felix.leg
CC BY-SA 4.0
2022-03-10T17:06:06.693Z
@Felix.leg  Would Celestia be of any help to you?  https://en.wikipedia.org/wiki/Celestia  and https://github.com/CelestiaProject/Celestia
Dave Gremlin
<night-sky><software>
Making an application to draw the night sky of other planets
Felix.leg
# Making an application to draw the night sky of other planets

(Asked by: username_0 on 2022-03-07)

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

[![an animation of the rotations](https://i.sstatic.net/LsAYz.gif)](https://i.sstatic.net/LsAYz.gif)

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:

[![Uranus night sky](https://i.sstatic.net/KtIt1.png)](https://i.sstatic.net/KtIt1.png)

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>

**Tags:** night-sky, software
> **Comments:**
> **username_1**: 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.  
> **username_2**: 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.  
> **username_1**: 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?  
> **username_0**: @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.  
> **username_0**: @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.  
> **username_3**: @Felix.leg  Would Celestia be of any help to you?  https://en.wikipedia.org/wiki/Celestia  and https://github.com/CelestiaProject/Celestia  

---

## 1 answers

### Answer by username_0 on 2022-03-11. Score: 3

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 :(


---

