Full source for astronomytonight.net, a site for amateur astronomers. The site has basic astronomy data for any location, and weather data for specific countries (the US and Canada). Customizable for your observing location.
There's a good technique described in the Observer's Handbook for calculating fairly precise positions over a limited time span (about a year). (See page 22, in the 2017 Handbook.)
The idea is to use two osculating orbits, taken for 2 specific moments, separated by ~6 months. For other moments, just use linear interpolation/extrapolation to get a good approximation to the orbit. This technique has a max error of ~2-3 arc seconds over a limited time span.
This algo is already mostly implemented. The exception is the Earth/Sun, where the current impl uses a mean orbit (less accurate). The problem, of course, is that the loss of precision for the Earth's position propagates to the calculated position of all the other planets. In other words, the Earth is the weak link in the chain here.
The fix needs :
a change in the algo for the position of the Earth/Sun
preferably, to account for the fact that, in the Observer's Handbook, the osculating orbit for the Earth is for the barycenter of the Earth-Moon system. At a distance of 1 AU, this changes positions by about 6 arcseconds.
There's a good technique described in the Observer's Handbook for calculating fairly precise positions over a limited time span (about a year). (See page 22, in the 2017 Handbook.)
The idea is to use two osculating orbits, taken for 2 specific moments, separated by ~6 months. For other moments, just use linear interpolation/extrapolation to get a good approximation to the orbit. This technique has a max error of ~2-3 arc seconds over a limited time span.
This algo is already mostly implemented. The exception is the Earth/Sun, where the current impl uses a mean orbit (less accurate). The problem, of course, is that the loss of precision for the Earth's position propagates to the calculated position of all the other planets. In other words, the Earth is the weak link in the chain here.
The fix needs :