I've done a programme for describing how the sphere attracts the comet

It shows the way the comet will be attracted by the sphere, and perhaps the other way round. There were problems when trying to run the function which I couldn't solve. Please if you see them try to fix them. I also don't know the way to put commments in here. Please fix any other problems you encounter