Coordinates in celestia

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Paolo-82

Coordinates in celestia

Post #1by Paolo-82 » 05.07.2004, 16:15

Hello!

I hope you can help me, and I'm sorry in advance for my English.

The question is:
I need to know where the coordinate (0, 0, 0) is in celestia, the origin of the axis.
Before I thought that the origin was on the Earth on the position of vernal equinox or on the Sun.
But if I force the position of a star in the position x=0, y=0, z=0 (or RA=0, dec=0 and distance=0), I can see that it isn't so. I modify the function StarDatabase::loadBinary(istream& in), I've added these lines: (nStars is a counter from 0 to totalStars)

Code: Select all

if(stars[nStars].getCatalogNumber() == 88140)
{
   star->setPosition(Point3f(0.0f, 0.0f, 0.0f));
   // or alternatively
   //star->setPosition(astro::equatorialToCelestialCart(0.0f, 0.0f, 0.0f));   
}

if(stars[nStars].getCatalogNumber() == 0) // the Sun
{
   cout << "RA: " << RA << " dec: " << dec << " parallax: " << parallax << " distance: " <<

distance << '\n';
}

After compiling I can see that the star HD88140 is very far from the Sun... Out of the solar system.
The Sun is far 0.00326167 light years (206 AU) along the x axis from the origin... Why?

Thanks.

Paolo

granthutchison
Developer
Posts: 1863
Joined: 21.11.2002
With us: 22 years

Re: Coordinates in celestia

Post #2by granthutchison » 05.07.2004, 16:37

Paolo-82 wrote:The Sun is far 0.00326167 light years (206 AU) along the x axis from the origin... Why?
The Sun is assigned Hipparcos number zero in Celestia's stars database (file stars.dat). Its other parameters are stored to conform to the Hipparcos dataset, which means that it must be assigned a trigonometrical parallax and an apparent magnitude, rather than a distance and an absolute magnitude. Celestia (more or less at random) assigns it the very high parallax of 1000000 milliarcseconds (corresponding to 0.00326167 ly), and an apparent magnitude of -15.168, which produces the correct calculated absolute magnitude. The Sun can't be placed at the origin of the coordinate system without having an infinite parallax and infinite apparent magnitude.

Maybe if Chris were doing it over again he'd choose to have distance and absolute magnitude fields in stars.dat, computed from the original Hipparcos data - that would then allow the Sun to be placed at the coordinate origin without creating infinities. But maybe there are other considerations I don't know about.

Grant

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Coordinates in celestia

Post #3by chris » 06.07.2004, 04:37

granthutchison wrote:Maybe if Chris were doing it over again he'd choose to have distance and absolute magnitude fields in stars.dat, computed from the original Hipparcos data - that would then allow the Sun to be placed at the coordinate origin without creating infinities. But maybe there are other considerations I don't know about.


Grant,
Excellent summary of why the Sun is not at (0, 0, 0) in Celestia. If there weren't compatibility concerns with existing scripts and cel URLs, I'd definitely change the stars.dat to use rectangular coordinates and absolute magnitudes to avoid problems at the origin.

--Chris

Guest

Post #4by Guest » 07.07.2004, 09:18

Thanks a lot for your reply! Now I have understood. :wink:


Return to “Development”