A well documented and portable Delphi Pascal source code module offering calculations about sun positions in the sky. It also calculates sunrise and sunset time values, given any location on earth and taking the earth precession and nutation into account. Those two effects are due to the wobbling of the earth axis while it rotates. Taking them into account give quite accurate results, including these in the distant past. And finally, it calculates distances between two points on the earth globe, correcting it for the earth flattening due to its rotation.
With the functions in this module, you can develop all kinds of projects requiring e.g. an exact sunrise or sunset value. An example is the animation of the day and night zones on earth, as shown in the video below.
Demonstration programs in VCL (Windows only) and Firemonkey (Windows, MacOS, iOS and Android) illustrate how to use the functions in this module. The picture below is a screenshot of the demonstration program showing values for different definitions of sunrise and sunset, given a location on earth, a time zone and the winter or summer time setting.