[Kstars-devel] branches/kstars/summer/kdeedu/kstars/kstars

Akarsh Simha akarshsimha at gmail.com
Thu Jul 10 22:37:59 CEST 2008


SVN commit 830613 by asimha:

Ensure that the value returned by StarObject::getIndexCoords() is
within the 0 - 360 degrees range.

CCMAIL: kstars-devel at kde.org



 M  +3 -1      starobject.cpp  


--- branches/kstars/summer/kdeedu/kstars/kstars/starobject.cpp #830612:830613
@@ -308,8 +308,10 @@
     dtheta.setRadians( atan2( sin( dir0 ) * sin( dst ) * dec0()->cos(),
                               cos( dst ) - dec0()->sin() * lat1.sin() ) );
 
+    // Using dms instead, to ensure that the numbers are in the right range.
+    dms finalRA( ra0()->Degrees() + dtheta.Degrees() );
 
-    *ra = ra0()->Degrees() + dtheta.Degrees();
+    *ra = finalRA.Degrees();
     *dec = lat1.Degrees();
 
     //    *ra = ra0()->Degrees() + dra;


More information about the Kstars-devel mailing list