WorldWideTelescope / wwt-web-client

The WorldWide Telescope web client lets you explore the universe in your browser.
https://worldwidetelescope.org/webclient/
MIT License
105 stars 35 forks source link

Southern Hemisphere Declinations Incorrect #107

Closed AstroRob closed 5 years ago

AstroRob commented 8 years ago

I ran into a significant bug when trying to locate a southern sky star in WWT. It appears that negative declinations are calculated/displayed incorrectly, offset with errors on the order of a degree or two.

One test: open WWT web client (HTML5 or Silverlight) and search for Sirius. When you go there (successfully) note that the center coordinate displayed for the star is not the coordinate for Sirius which should be: -16° 42′ 58.0171″

A more graphic illustration of the error can be found by going to the equator. Drag the image up, going from + to - declinations. Note the following transitions:

This is easy to see if you turn on equatorial grids and drag along one of them into negative declinations.

Weirdly it seems this has not affected the ability to correctly go to known objects at these decs, they are centered correctly but display incorrect coordinates.

RA is not affected. wwt sirius bad coordinates

AstroRob commented 8 years ago

Note I did check this in the Windows client (build dating from January, don't have the build number handy) and Dec displays correctly in it.

astrojonathan commented 8 years ago

This is a display issue. Before the Windows client was release I had the same bug in the Windows client and fixed it. The web client display probably ran into the same issue.

When you decompose a negative number into its components. You need to decompose the absolute value of it, then add the sign. Similarly when you parse several components you need to add each components absolute value, then apply the sign.

AstroRob commented 8 years ago

It is also a search issue. I ran across the problem when attempting to locate a star by tying its RA and Dec. It took me to the wrong place in the sky because it was using the messed up display coordinates. So it also prevents southern hemisphere positional searches from working correctly.

astrojonathan commented 5 years ago

Fixed. The formatting code was using Math.Floor on negative numbers causing the number to grown when negative for the first parameter.