Coding a system with sun moon and earth realistically

Please do not start a new discussion if it is simply s continuation of an existing discussion. You should make a new post on the existing discussion asking for further help.