vsop87.frink

//// Routines for parsing VSOP87 coefficient files and generating Frink code// from them (or, with small modifications, for other languages).// The output of running this program is a partial Frink program// that contains function definitions to find the coordinates of each planet.//// The full coefficients of the VSOP87 theory are available for download// from:// ftp://ftp.imcce.fr/pub/ephem/planets/vsop87///// From this, the series we require for use with the equations in Meeus// are the VSOP87D.xxx files, which contains the// heliocentric spherical variables referred to equinox and ecliptic of date.//// This reverses the lines in the file so that smaller coefficients are// added first, reducing numerical error.

println["""//// $planet// // This function calculates the heliocentric coordinates of $planet// referred to the mean equinox *of the date*. You may want to convert this// to another coordinate system, such as FK5.//// arguments:// d: the date/time to be calculated for// // returns:// [L, B, R]// // Where // L is the heliocentric longitude,// B is the heliocentric latitude// R is the distance from the sun.
${planet}HeliocentricCoordinates = {|d|