star distance calculation error (solved)

Report bugs, bug fixes and workarounds here.
Topic author
phoenix
Posts: 214
Joined: 18.06.2002
With us: 22 years 5 months
Location: Germany - Berlin

star distance calculation error (solved)

Post #1by phoenix » 14.09.2006, 11:17

hi,

I've noticed that celestia's shown star-distance in the upper left corner is somehow miscalculated.

lets take hip 32349 and hip 99240 for example.
celestia shows a rounded distance of 22.446 ly

using startextdump I extracted the XYZ values of those stars:

32349 -1.612565 -5.482873 -6.427964
99240 4.284276 -14.01134 13.49721

now calculating the distance like celestia does:

sqrt(($x1 - $x2) * ($x1 - $x2) + ($y1 - $y2) * ($y1 - $y2) + ($z1 - $z2) * ($z1 - $z2));

that gives me a excat distance of 22.4615235921 (rounded to 22.462)

I'm getting the same margin of error between 0.02 and 0.05 ly for any random stars-combination.
So, where is the error? wrong values in stars.txt or some miscalculation in celestia?
Last edited by phoenix on 15.09.2006, 13:39, edited 1 time in total.
most recent celestia win32-SVN-build - use at your own risk (copy over existing 1.5.1 release)

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

Post #2by ajtribick » 14.09.2006, 16:05

Is this to do with the solar system not being at the co-ordinate origin?

Try putting this .stc file in your extras directory (will break some cel URLs)

Code: Select all

0 "Sol:Sun"
{
   RA 0
   Dec 0
   Distance 0
   SpectralType "G2V"
   AbsMag 4.83

   RotationPeriod      609.12  # 25.38 days
   Obliquity             7.25  # correct orientation relative to ecliptic
   EquatorAscendingNode 75.77  #
   RotationOffset       23.00  # standard meridian
}


Does the problem remain?

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #3by Cham » 14.09.2006, 17:00

It is time that we put back our sun on its right place. Who cares about breaking some old cel URL ? Please, put back our star at its place for accuracy !
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Post #4by Malenfant » 14.09.2006, 17:07

Cham wrote:It is time that we put back our sun on its right place. Who cares about breaking some old cel URL ? Please, put back our star at its place for accuracy !


Yeah, I agree here - not having the sun at 0,0,0 is ridiculous. If there's a new Celestia 1.5.0 coming out, this should be changed for that.
My Celestia page: Spica system, planetary magnitudes script, updated demo.cel, Quad system

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

Post #5by ajtribick » 14.09.2006, 17:52

From what I can tell, the speed of light is being fixed in 1.5.0, which would break the cel URLs anyway.

So we might as well put Sol at the centre. Or maybe the Sol-Jupiter barycentre?

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #6by Cham » 14.09.2006, 18:06

And if really some of those broken cel URL are still alive, their creator will update them.

So PLEASE Chris, update Sol's position ! In the name of accuracy !!
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Post #7by chris » 14.09.2006, 18:14

I intend to make the origin the solar system barycenter, not the sun itself. The International Celestial Reference System uses the solar system barycenter as it's origin. With a new feature in Celestia 1.5.0, it will be possible to set the origin of a Sun-orbiting body to either the solar system barycenter or the Sun. It will be interesting to watch the Sun's movement around the barycenter.

--Chris

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #8by Cham » 14.09.2006, 18:20

Will sun's movement be perceptible ? I always believed it was very small in amplitude.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Post #9by chris » 14.09.2006, 18:38

Cham wrote:Will sun's movement be perceptible ? I always believed it was very small in amplitude.


The solar system barycenter lies just outside of the Sun, so the movement will be easily to see if you pick a coordinate system that's fixed with respect to the barycenter.

--Chris

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #10by Cham » 14.09.2006, 18:44

Then this would be a good feature, to be able to see this.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
PlutonianEmpire M
Posts: 1374
Joined: 09.09.2004
Age: 40
With us: 20 years 2 months
Location: MinneSNOWta
Contact:

Post #11by PlutonianEmpire » 14.09.2006, 19:12

chaos syndrome wrote:From what I can tell, the speed of light is being fixed in 1.5.0, which would break the cel URLs anyway.

So we might as well put Sol at the centre. Or maybe the Sol-Jupiter barycentre?

The speed of light wasn't accurate in celestia before?
Terraformed Pluto: Now with New Horizons maps! :D

Topic author
phoenix
Posts: 214
Joined: 18.06.2002
With us: 22 years 5 months
Location: Germany - Berlin

Post #12by phoenix » 14.09.2006, 19:16

chaos syndrome wrote:Is this to do with the solar system not being at the co-ordinate origin?

Try putting this .stc file in your extras directory (will break some cel URLs)

Code: Select all

0 "Sol:Sun"
{
   RA 0
   Dec 0
   Distance 0
   SpectralType "G2V"
   AbsMag 4.83

   RotationPeriod      609.12  # 25.38 days
   Obliquity             7.25  # correct orientation relative to ecliptic
   EquatorAscendingNode 75.77  #
   RotationOffset       23.00  # standard meridian
}


Does the problem remain?


no the distance is still off by about 0,016 ly
moving the solar system to 0,0,0 is about 206.8 au from its original position.
but if only the coordinate-system is shiftet, the relative distances between the stars would remain intact.
something else is wrong here, maybe the difference between the star and the observer is taken into account but not calculated right towards the other star.
most recent celestia win32-SVN-build - use at your own risk (copy over existing 1.5.1 release)

rra
Posts: 171
Joined: 17.07.2004
With us: 20 years 4 months
Location: The Netherlands

Post #13by rra » 14.09.2006, 19:33

maybe a little off-topic to this discussion,
but how do you get Celestia to show the distance between
stars in the top-left corner ??

Ren?©

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

Post #14by selden » 14.09.2006, 19:34

GoTo one of them
and Select the other.
Selden

Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Post #15by Malenfant » 14.09.2006, 19:57

chris wrote:I intend to make the origin the solar system barycenter, not the sun itself. The International Celestial Reference System uses the solar system barycenter as it's origin. With a new feature in Celestia 1.5.0, it will be possible to set the origin of a Sun-orbiting body to either the solar system barycenter or the Sun. It will be interesting to watch the Sun's movement around the barycenter.

--Chris


That'll work too :)
My Celestia page: Spica system, planetary magnitudes script, updated demo.cel, Quad system

TriKri
Posts: 4
Joined: 12.09.2006
With us: 18 years 2 months

Post #16by TriKri » 14.09.2006, 20:33

How many at this forum is working with the code of celestia? Are you all programmers?
KriPPa

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #17by Cham » 14.09.2006, 20:56

phoenix wrote:no the distance is still off by about 0,016 ly
moving the solar system to 0,0,0 is about 206.8 au from its original position.
but if only the coordinate-system is shiftet, the relative distances between the stars would remain intact.
something else is wrong here, maybe the difference between the star and the observer is taken into account but not calculated right towards the other star.


No, it isn't about the coordinate system. The coordinate system is ok, it is only the position of Sol which isn't correct. So changing that position will change the relative distance. It's not enough to explain your discrepancy, however.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

rra
Posts: 171
Joined: 17.07.2004
With us: 20 years 4 months
Location: The Netherlands

Post #18by rra » 14.09.2006, 21:16

No, it isn't about the coordinate system. The coordinate system is ok, it is only the position of Sol which isn't correct. So changing that position will change the relative distance. It's not enough to explain your discrepancy, however.


What do you mean Cham ,
how can the distance between 2 bodies (stars) be different if the observer-coordinate changes ?

Ren?©

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #19by Cham » 14.09.2006, 21:18

rra wrote:
No, it isn't about the coordinate system. The coordinate system is ok, it is only the position of Sol which isn't correct. So changing that position will change the relative distance. It's not enough to explain your discrepancy, however.

What do you mean Cham ,
how can the distance between 2 bodies (stars) be different if the observer-coordinate changes ?

Ren?©


The problem is with Sol's position, and NOT the coordinate system. Actually, Sol isn't placed at (0, 0, 0). It should be there ! That's all.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

rra
Posts: 171
Joined: 17.07.2004
With us: 20 years 4 months
Location: The Netherlands

Post #20by rra » 14.09.2006, 21:28

The problem is with Sol's position, and NOT the coordinate system. Actually, Sol isn't placed at (0, 0, 0). It should be there ! That's all.



I know that, but what has that got to do with the fact that the distance between the stars is not calculated correctly. I shouldn't matter at all.


Ren?©


Return to “Bugs”