I derived the following formula to estimate sunrise and sunset times:
$$ t=\pm\cos^{-1}\frac{\sin\theta-\sin L_{loc}\sin L_{sun}}{\cos L_{loc}\cos L_{sun}} $$
- $L_{loc}$ is the local latitude
- $L_{sun}$ is the solar latitude
- $\theta$ is the desired solar altitude angle (for sunset and sunrise, I used $\theta=0$)
- $t$ is the time, expressed as an angle of a 24-hour clock, and measured from solar noon
I used the solar latitude from here, and the times and local latitude for New York from here (it was October 20, 2020; link to correct month).
I tried this with my location and was about 4 minutes off with sunrise and sunset, and I tried it for New York and was also about 4 minutes off (I got 7:18:15am for sunrise and 6:02:55pm for sunset).
I'm wondering what are the main sources of error in my formula? My goal is for it to be accurate at least within a minute, and hopefully even down to a few seconds. What factors do I need to take into account in order to reach this level of accuracy?
Thanks!