[Kstars-devel] KDE/kdeedu/kstars/kstars

Médéric Boquien mboquien at free.fr
Sun Feb 15 16:20:15 CET 2009


SVN commit 926507 by mboquien:

Commit slight refactor in the calculation of the moon's magnitude. Patch by Khudyakov Alexey. Thanks!
CCMAIL: kstars-devel at kde.org


 M  +2 -6      ksplanetbase.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/ksplanetbase.cpp #926506:926507
@@ -322,12 +322,8 @@
         int i = p / 10;
         int k = p - 10 * i;
         int j = (i + 1 > 18) ? 18 : i + 1;
-        if( i < 0 )
-            i = -i;
-        if( j < 0 )
-            j = -j;
-        i = 18 - i;
-        j = 18 - j;
+        i = 18 - abs(i);
+        j = 18 - abs(j);
         magnitude = KSMoon::MagArray[ i ] + ( ( KSMoon::MagArray[ j ] - KSMoon::MagArray[ i ] ) * k / 10 );
     }
 


More information about the Kstars-devel mailing list