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

Akarsh Simha akarshsimha at gmail.com
Wed Aug 26 17:22:25 CEST 2009


SVN commit 1015904 by asimha:

After much reminding from Prakash, here goes...

Uncomment (and fix) method to find out when the sun attains a given
zenithal distance.

This method should be useful for finding out end-of-twilight times,
but it should be made more accurate than that. (It doesn't account for
the motion of the sun)

CCMAIL: kstars-devel at kde.org



 M  +4 -3      ksalmanac.cpp  
 M  +8 -0      ksalmanac.h  


--- trunk/KDE/kdeedu/kstars/kstars/ksalmanac.cpp #1015903:1015904
@@ -97,11 +97,12 @@
     update();
 }
 
-/*
+
 double KSAlmanac::sunZenithAngleToTime( double z ) {
+    // TODO: Correct for movement of the sun
     double HA = acos( ( cos( z * dms::DegToRad ) - m_Sun->dec()->sin() * geo->lat()->sin() ) / (m_Sun->dec()->cos() * geo->lat()->cos()) );
     double HASunset = acos( ( -m_Sun->dec()->sin() * geo->lat()->sin() ) / (m_Sun->dec()->cos() * geo->lat()->cos()) );
-    return SunSet*24*60 + ( HA - HASunset ) * 4.0 * 15.0;
+    return SunSet + ( HA - HASunset ) / 24.0;
 }
-*/
+
     
--- trunk/KDE/kdeedu/kstars/kstars/ksalmanac.h #1015903:1015904
@@ -81,6 +81,14 @@
     inline QTime sunSet() { return SunSetT; }
     inline QTime moonRise() { return MoonRiseT; }
     inline QTime moonSet() { return MoonSetT; }
+
+    /**
+     *@short Convert the zenithal distance of the sun to fraction of the day
+     *@param z Zenithal angular distance
+     *@return Time as a fraction of the day, at which the zenithal distance is attained by the sun
+     *@note This is accurate only for zenithal angles close to sunset. TODO: Make this more accurate
+     */
+    double KSAlmanac::sunZenithAngleToTime( double z );
     
 private:
     // TODO: Add documentation


More information about the Kstars-devel mailing list