I want to calculate Daylight hours based on given Latitude and Longitude and DateTime
I mean calculate the time of sunrise and the time of sunset in a specefic Date and based on gegraphic coordinate.
相关问题
- Finding k smallest elements in a min heap - worst-
- binary search tree path list
- High cost encryption but less cost decryption
- How to account for clock offsets in a distributed
- How to get a fixed number of evenly spaced points
相关文章
- What are the problems associated to Best First Sea
- Coin change DP solution to keep track of coins
- Algorithm for partially filling a polygonal mesh
- Robust polygon normal calculation
- Algorithm for maximizing coverage of rectangular a
- Get POSIX epoch as system_clock::time_point
- How to measure complexity of a string?
- Select unique/deduplication in SSE/AVX
Check this Latitude and Longitude and Daylight Hours
Here is a python function that returns the number of hours of daylight with arguments of latitude and day of the year(number between 1-356):
I just answered another question, and think that my solution is fitting here aswell. It's a Javascript solution, so you should be able to convert easily to other languages if you need.
I've created a repository under GitHub Sundial it is licenced under the permissive modified BSD license, so you can use it freely in your own projects.
It should be accurate to 0.0001 minutes and takes into account the axial tilt of the earth, and the equation of time.
Sundial AMD Loadable Sun Day Light Calculator
Demo jsFiddle
You can check out a demo of how you might use it on jsfiddle.
http://jsfiddle.net/wjKRw/
And then when I get around to it, check out the sample use cases at the repository. GitHub Sundial
sin24+(24cos-18^12)^(day number of the year)+(latitude)^24= #of daylight hours