iPhone 4 calculate Day Duration programmatically from GPS latitude and day of the year
I'm looking at this wikipedia article:
http://en.wikipedia.org/wiki/Day_length
http://en.wikipedia.org/wiki/Sunrise_equation
Anybody had experience calculating Sunrise/Sunset times on iOS using the equations above with latitude given by the GPS?
I'm also interested in the Solar Noon. The idea is to create a clock in which the sun revolves around a fixed button, indicating time in a truly "analog" sense... The Sunrise/sunset times would then allow me to position the orbit of the "sun" around the button for a given day of the year, giving the impression of how much daylight time there will be, and how much has already expired.
Somehow iPhone adjusts b开发者_JS百科rightness automatically, do you know if that is based on the ambient light via light sensor or some kind of calculation like the one that I'm trying to do above? Maybe there's already something out there that I can use?
Thank you, I'm sure this information will benefit not just me!
I found this source in C++, but am not sure how to integrate it into an existing Xcode project. http://www.sci.fi/~benefon/rscalc_cpp.html
Here is a objective-c framework to calculate sunrise and sunset based on the location.
The iPhone adjusts its brightness by a sensor detecting ambient light.
精彩评论