Continuing on the topic started in the article Sunrise and sunset calculator.
Calculating the sun's azimuth and its altitude above the horizon at any time at the point with given coordinates is on the agenda. We calculate azimuth from the north in a clockwise direction.
I used this algorithm. Some good old Swede described it. He tried as hard as he could, but a casual person still wouldn't understand it. For example, I can still understand how we move from one coordinate system to another, but I can't get why the longitude of the perihelion of the Sun is calculated like that
, where d is - the number of days out of epoch J2000 - that's beyond my strength.
It seems like somewhere far away, in an ivory tower sitting the astronomers and calculating this, and then all of us, mortals, use this then. Maybe some of these astronomers will explain things to us, but we have to believe in all these magical numbers and perform the calculation for now.
Apparently, so does the majority of people.
Some books are usually recommended to people on forums when somebody doesn't want to explain things and say "search there". I also would like to put these books here:
Jean Meeus. Astronomical algorithms
Peter Duffett-Smith. Practical Astronomy with your calculator.
As in the case of calculators of the time of sunrise and sunset, here are two calculators - the first uses the information about the coordinates and the time zone information from the directory of cities, i.e., you have to choose the city and enter the time of observation, and the second allows you to set the coordinates and time zone manually. Information about the city can be added to the directory by the registered users.
The negative altitude above the horizon corresponds to the dark time of the day - the Sun is "under" the horizon. The intersection with the horizon in the morning occurs at the 90 degrees azimuth, from which you can make a bold conclusion that the Sun still rises in the East.
Paul Schlyter (that Swede) claims that the calculations' error does not exceed one minute of arc for dates in the range from 1900 to 2100.