[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkstars/4=2E6=5D_kstars/tools=3A_Set_initial_guesses?=
From: Khudyakov Alexey <alexey.skladnoy () gmail ! com>
Date: 2011-05-07 19:46:20
Message-ID: 20110507194620.03A5EA60C9 () git ! kde ! org
[Download RAW message or body]
Git commit 1a74061721dd0757e6efada938f38037d0c4f1b1 by Khudyakov Alexey.
Committed on 07/05/2011 at 20:39.
Pushed by khudyakov into branch '4.6'.
Set initial guesses for calculation of equinox to February 1 and
August 1 to be sure that the are before equinox.
Backport fix for #272721 to 4.6
M +5 -4 kstars/tools/modcalcvizequinox.cpp
http://commits.kde.org/kstars/1a74061721dd0757e6efada938f38037d0c4f1b1
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