[Kstars-devel] Prakash's KSalmanach
Khudyakov Alexey
alexey.skladnoy at gmail.com
Sat May 23 17:57:25 CEST 2009
Hello
I've just checked out summer branch and looked through it.
Begin/end time of twilight are calculated incorrectly. One cannot just use
linear interpolation to obtain this times. Code below.
> double KSAlmanac::getCivilTwilight( bool begin ) {
> if(begin) return ( SunRise - 6 * riseRate );
> return ( SunSet + 6 * riseRate );
> }
This way calculated twilights are longer than real. Moreover solution always
exist even if sun never goes below 6/12/18 degrees.
Right way to do this is to find when Sun goes above/below -6/12/18 deg. as done
in SkyObject::riseSetTime. However it will require a lot of changes to that
function.
P.S.
Quick hint to Prakash.
You need not to explicitly cast KSsun* and KSMoon* to SkyObject*. Since they
are subclasses they will be casted automatically.
> RiseSetTime( (SkyObject*)m_Sun, ....
> RiseSetTime( (SkyObject*)m_Moon, ....
--
Best regards Khudyakov Alexey
More information about the Kstars-devel
mailing list