User:MadeYourReadThis/sunrise

Formula
A formula for calculating the time ($$Time_{\text{sunrise}}$$) (in hours and fractions of hours) of sunrise based for a given date, longitude and latitude on Earth:



day_{\text{oftheyear}}= day + \left \lfloor \frac {month * 275}{9} \right \rfloor - \left ( \left \lfloor \frac {month + 9}{12} \right \rfloor \left ( 1 + \left \lfloor \frac { year - 4 * \left \lfloor \frac {year}{4} \right \rfloor + 2}{3} \right \rfloor \right ) \right ) - 30 $$



M_{\text{anomoly}} =

\left (0.9856 * \left ( day_{\text{oftheyear}} + \frac{6 - \frac {longitude}{15}}{24} \right ) \right ) - 3.289 $$



RA =

\arctan \left(0.91764 * \tan(M_{\text{anomoly}} + (1.916 * \sin(M_{\text{anomoly}})\right) + \left(0.020 * \sin(2 * M_{\text{anomoly}})) + 282.634)\right) $$



Time_{\text{sunrise}} = H + RA - (0.06571 * t) - 6.622 $$