Approximate geocentric position and velocity of the Moon.
iy int year AD id int day in year (1 = Jan 1st) fd float fraction of day
posvel float Moon position & velocity vector
slaCs2c6, slaEuler, slaMxv The date and time is TDB (loosely ET) in the Gregorian calendar, and is interpreted in a manner which is valid between 1900 March 1 and 2100 February 28. The Moon 6-vector is Moon centre relative to Earth centre, mean equator and equinox of date. Position part, posvel(0-2), is in AU; velocity part, posvel(3-5), is in AU/sec. The position is accurate to better than 0.5 arcminute in direction and 1e-5 AU in distance. The velocity is accurate to better than 0.5"/hour in direction and 4 m/s in distance. Note that the distance accuracy is comparatively poor because this routine is merely intended for use in computing topocentric direction.
Meeus, l'Astronomie, June 1984, p348. This routine is only a partial implementation of the original algorithm, which offers somewhat higher accuracy in direction and much higher accuracy in distance (or rather in horizontal parallax) when fully implemented. P.T.Wallace Starlink 16 November 1993