I reckon this is almost certain to be a floating point rounding/truncating error.

You say 'especially spaceship' - and this is because you will notice the imperfections much more due to scale.

I have seen errors with the double type such as:

double a=9,999,999,999.0;
a=a+0.900319;
...giving the result a=9,999,999,999.900318

This looks small but could equate to a couple of meters (or more - depending on what your doing) in astronmical terms - causing a small craft to judder about!

By the way - look at the following line:-
#define UNIVERSERADIUS 10000000.0 /* Somewhere beyond Pluto */

What does 1 of these units equal?

Kind regards
Jez
Jez1@talk21.com