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

List:       kde-commits
Subject:    =?utf-8?q?=5Bkstars=5D_kstars/tools=3A_Set_initial_guesses_for_c?=
From:       Khudyakov Alexey <alexey.skladnoy () gmail ! com>
Date:       2011-05-07 18:58:59
Message-ID: 20110507185859.ABCB5A60B0 () git ! kde ! org
[Download RAW message or body]

Git commit 1d0d5d67329b7cb5ac49b37aec7208975f67a48e by Khudyakov Alexey.
Committed on 07/05/2011 at 20:39.
Pushed by khudyakov into branch 'master'.

Set initial guesses for calculation of equinox to February 1 and
August 1 to be sure that the are before equinox.

BUG: 272721

M  +5    -4    kstars/tools/modcalcvizequinox.cpp     

http://commits.kde.org/kstars/1d0d5d67329b7cb5ac49b37aec7208975f67a48e

diff --git a/kstars/tools/modcalcvizequinox.cpp b/kstars/tools/modcalcvizequinox.cpp
index 87d5e6f..5ee1ca1 100644
--- a/kstars/tools/modcalcvizequinox.cpp
+++ b/kstars/tools/modcalcvizequinox.cpp
@@ -251,10 +251,11 @@ void modCalcEquinox::addDateAxes() {
 }
 
 KStarsDateTime modCalcEquinox::findEquinox( int year, bool Spring, KPlotObject *ecl ) {
-    //Interpolate to find the moment when the Sun crosses the equator in March
-    int month = 3;
-    if ( ! Spring ) month = 9;
-    int i = QDate( year, month, 16 ).dayOfYear();
+    // Interpolate to find the moment when the Sun crosses the equator
+    // Set initial guess in February or August to be sure that this
+    // point is before equinox.
+    const int month = Spring ? 2 : 8;
+    int i = QDate( year, month, 1 ).dayOfYear();
     double dec1, dec2;
     dec2 = ecl->points()[i]->y();
     do {


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

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