# Function to determine Earth-Moon distance vs. time

I had no luck trying to find a function that determines the distance between Earth and Moon versus time.

(Moon ground level to Earth sea level)

Accuracy:

• the acceptable time range would be for years in [ 1900, 2100 ]
• 1 km error margin (or better)
-
You're not going to get a closed-form analytical solution for this. The three body problem is known to be chaotic, so as soon as you factor in the gravitation of bodies other than the Earth and the Moon, there is no analytic function that describes the paths of the two bodies. The best you're going to do is empirical or numerical data, depending on your purpose. (or you can just solve the Kepler problem, and ignore anything but the Earth's and Moon's gravitation, and treat them like point masses) – Jerry Schirmer Mar 7 '12 at 13:38
@Jerry The closed form would certainly be too complex for what I need, while the Sun may also be factored in? (the other influences like other planets, comets, asteroids collision... seem hard to integrate) Considering the acceptable error margin above, the numerical application (ie the formulas having a number of constants in it) will be enough. I'm planning on purchasing the book from J.Meeus. Thanks – ringø Mar 7 '12 at 14:30
even the earth, moon and sun system is not solveable in analytic closed form: en.wikipedia.org/wiki/Three-body_problem – Jerry Schirmer Mar 7 '12 at 21:48

You can check Meeus 'Astronomical Algorithms' (1st Ed), Chapter 51. It is implemented for example in the (Javascript) source code of this page for example.

-
Thanks but I'd prefer to rely on some formulas - that people here can look at - than to reverse engineer a JS code, which implementation may not be accurate. – ringø Mar 7 '12 at 13:01
@ring0 I was only suggesting that you retrieve the reference from the code’s comments. I have now replaced my answer with this reference. – F'x Mar 7 '12 at 13:06
@F\'x thanks, good idea. Btw, how did you find the ephemerids.htm page... it's not linked from the top page(?) – ringø Mar 7 '12 at 16:27
@ring0 Google :) – F'x Mar 7 '12 at 17:01