[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars
From:       Jason Harris <kstars () 30doradus ! org>
Date:       2008-01-15 15:14:45
Message-ID: 1200410085.348527.25360.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 761886 by harris:

Fix embarrasing moon phase bug (the bright side of the moon pointed
away from the Sun).  The problem was not with the calculation of the
phase angle itself, it was that all the planets' position angles on
the sky were wrong by 180 dgrees.  This was caused by the move from
atan() to atan2() in calculating the position angle.  atan() masked
the sign error which got exposed when atan2() was used.

Thanks for letting me know about this James.

CCMAIL: kstars-devel@kde.org




 M  +7 -3      ksplanetbase.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/ksplanetbase.cpp #761885:761886
@@ -184,16 +184,20 @@
     SkyPoint test;
     dms newELat( ecLat()->Degrees() + 1.0 );
     test.setFromEcliptic( num->obliquity(), ecLong(), &newELat );
-    double dx = test.ra()->Degrees() - ra()->Degrees();
-    double dy = dec()->Degrees() - test.dec()->Degrees();
+    double dx = ra()->Degrees() - test.ra()->Degrees(); 
+    double dy = test.dec()->Degrees() - dec()->Degrees();
     double pa;
     if ( dy ) {
-        pa = atan2( dx, dy )*180.0/dms::PI;
+      pa = atan2( dx, dy )*180.0/dms::PI;
     } else {
         pa = 90.0;
         if ( dx > 0 ) pa = -90.0;
     }
     setPA( pa );
+
+    //DEBUG
+    kDebug() << QString("%1: %2 %3 %4").arg(name()).arg(pa).arg(dx).arg(dy) << endl;
+
 }
 
 double KSPlanetBase::labelOffset() const {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic