CalHeb The Algorithm of calculation of hours of Shabbat

Calculation algorithm of ignition Shabbat candles and the End of Shabbat times.
Principles:
We light the candles on Shabbat and Yom Tov 18 fixed minutes before the sunset.The End of Shabbat is not a time of sunset but hen it is 8.5° Under the horizon.
Formulas mathematics:
I found all the mathematical formulae of sunset on the site of jean-paul cornecHowever these require adaptations.
Indeed, for the Friday evening We calculate first time sunset, that is to say, the hen Soleil 50 'below the horizon.
It is therefore the formula :
cos (Ho) = [ –0,01454 – sin ( Dec ) * sin ( Lat ) ] / [ cos ( Dec ) * cos ( Lat ) ]
where –0,01454 is well 0°,50'
[The non–mathematicians should know that:
–0,01454 = sin(o,8333) = sin(50/60)
If Cos(X) = Y then X = Arcos(Y)
If Sin(X)= Y then X = Arcsin(Y)]
Are removed at the time found 18 Minutes.
On Saturday evening to change the formula thus :
cos (Ho) = [ – 0.14780941112961061834511903745759 – sin ( Dec ) * sin ( Lat ) ] / [ cos ( Dec ) * cos ( Lat ) ]
where – 0.14780941112961061834511903745759 rrepresents 8°.5'.
All other forms are identical to the above site.
Now we have good formulas, we can create the Algo
The necessary information:
- The Date of Friday and Saturday.
- T he coordinated geographic: latitude (Lat) and longitude (Lon) of the place.
- The time zone F of the place
THE ALGO :
- 1) We transform the geographical coordinates in decimal to simplify calculations.
Which means that is divided the Minutes by 60 and thats
The longitude is counted positive West and negative al' West of the Meridian
The latitude is counted positive to the North and South of the Equator negative. - 2) On calculated row j of the day in the year and the solar declination value see jean-paul cornec
- 3) Calculation time of sunset at; 0°50' for Friday
- 4) Changes the time taking into account the transition to summer or winter time.
- 5) We start again all calculations for Saturday night with the modification of the formula
calculation time of sunset at 8°.5' indicates above.
Friday 03/17/2012
J = 76
M= 71.9056
C = 1.831154178596
L = 356.7367541786
R = 0.2682081433865
EQT = 8.397449287932
Sin(declination) = –0.02264420705495
Cos(Ho) = 0.003808811729009
Sunset – 18 Minutes = 18.96985330827 or 18:39
and Saturday 03/18/2012
J = 77
M= 72.8912
C = 1.840548118164
L = 357.7223541786
R = 0.1873809808637
EQT = 8.111716396112
Sin(declination) = –0.01580934762245
Cos(Ho) = –0.2064942203764 [Caution Cos(Ho) Formula Modified]
End of Shabbat = 19.77410527022 or 19:46