I'm currently using this code to calculate the sunrise / sunset times. (To be more precise, I'm looking for civil dawn / civil dusk times which are defined as the time when the sun is between 0° and -6° altitude). As a next step, I'd like to compute the dawn beginning and dusk ending times. I believe the calculations must be very similar.
My idea is that if I want to calculate the dawn beginning (dusk ending) time for a place I just calculate the sunrise (sunset) times for a place 6° farther east (west).
Can somebody confirm this assumption, or am I thinking wrong?
Thanks for answers!
-- Ry
EDIT: Thought about it a little more and came to the conclusion that my assumption is wrong. Moving 6° East is wrong, moving 6° orthogonal to the light/shadow-border would be right. (It becomes obvious if you imagine the earth's axis not being tilted by 23.xx° but 90° - moving east wouldn't change anything).
The code that you link to uses a constant (90.833) in the calcHourAngle*
methods. If you look at these definitions of sunrise/sunset, you will notice that same 90.833 constant under Technical Definitions and Computational Details. A little further down, under civil twilight, the similar constant of 96 is used. Perhaps changing that constant would get what you are looking for?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With