As i posted in reddit, i have been messing with spherical harmonics which are determined in order to measure gravity variations. I have drawn variations of gravity of the Earth, and more relevantly to the project, the Moon. Got the data from nasa, which has it's data pretty accessable there, and looks like the format is the same for the other planet. (nicely done.) For Earth i got the data here, data which should be very similar to the data Nasa has, but i haven't checked.
Of course it is easy to calculate the gravity at any position, but with ~34k components for Earth and ~10k for the Moon, all of which have to be added, it gets slower then one would want, and much of it doesn't really matter. I should figure out how to determine which components are important based on 1) error for which we don't care, 2) errors in the angle/timestep size. 3) Errors in the data insofar as the source hasn't left those out in the first place. To determine this, i wanted to make a list of maximum component sizes for each m, and then figure out/estimate the maximum of the components. However, i can't seem to figure out the maximum of the legendre function. Of course other approaches then finding the exact maximum are possible. We only need a good estimate..
The first lunar landings were off due to variations in the Moons gravity, i don't think variations of the Earths gravity will be strong enough to be important though. (Except maybe Earth's flattening.) Of course, this only being important for the moon means i am considering this a bit early.. I made it just for the heck of it a little, and maybe for a 'map of the universe'-goal(ish) project at some point later.
Code ~600 lines of common lisp, although not all functions are used. Uses lispbuilder-sdl, cl-opengl, and Gsl functions imported with cffi.