Ecliptic rectangular coordinates in .stc files

Discussion forum for Celestia developers; topics may only be started by members of the developers group, but anyone can post replies.
Topic author
ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Ecliptic rectangular coordinates in .stc files

Post #1by ajtribick » 26.01.2023, 20:06

The problem: it is not possible to guarantee an entry in an .stc file will result in the same coordinates as an entry in the stars.dat file.

The reason: .stc files provide a spherical polar coordinate system in the equatorial frame, while stars.dat and Celestia's internal code use rectangular coordinates in the ecliptic frame. The stars.dat file can therefore be translated directly into Celestia's internal coordinates, while a .stc entry first has to be converted to rectangular coordinates (involves a bunch of trigonometric functions), then rotated into the ecliptic frame (quaternion multiplication). It is therefore difficult and in some cases may be inmpossible to find a set of input coordinates in the .stc file that produce a given set of rectangular coordinates from .stc

Proposed solution: a new property in the .stc file that allows specifying rectangular coordinates in the ecliptic frame. I'm proposing the name EclipticXYZ for this, usage, e.g.

Code: Select all

TestStar {
    EclipticXYZ<ly> [ 1.2 3.4 5.6 ] # default units are light years
    AbsMag 7.8
    SpectralType "?"
}


If specified together with RA/Dec/Distance, EclipticXYZ wins. (OrbitBarycenter wins over EclipticXYZ)

This would probably be most useful for people processing stars.dat with automated tools. It would nevertheless be a really bad idea to convert the whole of stars.dat to a .stc file, as this would waste disk space and processing time on startup.

Questions:
  • Does this seem like a useful addition?
  • Any better names than "EclipticXYZ" for this?

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #2by selden » 26.01.2023, 21:11

EclipticCartesian ?
Selden

Topic author
ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Post #3by ajtribick » 27.01.2023, 18:23

Actually it turns out there is a property in .dsc files that does this already, called Position. Since I don't want to introduce yet another incompatiblity between how .stc and .dsc files work, I'll use that.


Return to “Ideas & News”