Is there a function/algorithm that allows me to input the latitude and the approximate orbital position of the earth in so that I can determine how long the sun is up? IE during the winter it would show that the sun is only up a few hours in the far north hemisphere.
I did some basic Google search and didn't find much so I was thinking that I might have to do some trigonometry that would allow me to calculate how much the earth is inclined or not toward the sun then use that information along with the latitude to figure out how much sunshine a site would be getting.
cos(ω) = − tan(δ) tan(δ) = −1, which gives ω = 180◦ ⇒ sunrise = midnight. So the sun rises, at exactly the time it sets. There are 24 hours of daylight with the sun just dipping below the horizon at precisely midnight.
Sunrise/Sunset Calculations where the positive number corresponds to sunrise, negative to sunset. Then the UTC time of sunrise (or sunset) in minutes is: sunrise = 720 – 4*(longitude + ha) – eqtime where longitude and hour angle are in degrees and the equation of time is in minutes.
The hour angle is converted to a number of minutes by multiplying the angle by 4 minutes per degree of hour angle, then that number of minutes is subtracted from 12:00 noon for the time of sunrise and added to 12:00 noon for the time of sunset, both in local solar time (LSoT).
Areas on the Equator have a constant 12 hours of day light all year round. As latitude increases to 80° (polar circles - north or south) day length can be seen to increase to 24 hours or decrease to zero (depending on time of year).
Nice problem. Would this Sunset/Sunrise algorithm be helpful?
Source:
Almanac for Computers, 1990
published by Nautical Almanac Office
United States Naval Observatory
Washington, DC 20392
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