I hope you had a great weekend and a great Thanksgiving. For those of you in the United States, hopefully Friday was peaceful and not crazy.
HP Prime: Approximating the Length of Daylight in Hours
This time, we are taking a slightly more complex formula. The inputs are:
lat = Earth's latitude of the observer. (from -90° (South) to 90° (North))
day = the number of days since the December solstice (around December 21-22). Note that is different from many approximate formulas which used the vernal equinox as a starting point.
The formula used is a simplification of the Final Formula presented by Herbert Glarner (http://www.gandraxa.com/). For the complete article and the derivation, please click on link:
http://www.gandraxa.com/length_of_day.xml (Retrieved November 23, 2015)
The algorithm used in the DAYLIGHT is:
With the inputs lat and day:
m = 1 – tan(lat°) * tan(23.439° * cos(480/487 * day))
If m > 2, let m = 2. If m < 0, let m = 0.
b = acos(1 – m)/180 *24
Where b is the length of daylight in hours.
I adjusted the formula to allow for all inputs to be in degrees. Glamer had mixed inputs for the trigonometric functions.
Here is the program:
// latitude, days from
// December solstice
HAngle:=1; // Degrees
IF m<0 THEN
IF m>2 THEN
b:=ACOS(1-m)/180*24; // hours
Let’s assume a 365 day and the December solstice was December 22.
Latitude: -60°, March 1 (day = 69)
Result: Approx. 16.67808 hours
Latitude: 54°, July 24 (day = 214)
Result: Approx. 16.03426 hours
For another approximate formula, I wrote on one for the HP 35S here: http://edspi31415.blogspot.com/2013/05/hp-35s-approximate-length-of-sunlight.html
Have a great day,
This blog is property of Edward Shore. 2015