Hi, I am not sure whether this has been answered before and if so can someone point me to a post or two... but I am trying to simulate the orbit of an object (say a satellite) with another larger object (say a planet) on just the X axis ( and hopefully afterwards the y and z). The problem I am having is that I am unsure of how to code it in a way that will be a realistic simulation as the satellite is updated using its own velocity and the pull from the planet but as the satellite gets closer to the planet and its velocity increases, the amount at which I need to move the satellite increase significantly and when it reaches the center of the planet(the satelites highest velocity) it jump past the planet, missing the calculations on the other side of the planet which would slow it down.
I hope that isnt too confusing. Anyways.. I have looked around and the only ways I can see to counter this issue.. is to calculate the position of the object at a given time and then just keep updating the statelite given the time.. or to only move the object a tiny amount of distance but increase or decrease the programs frame rate dependent on the satellites velocity.
I am sure there must be some solution to this as I have seen many good simulators (even tho not many are willing to share code)..
Any help would be sooooooo grateful...
I hope that isnt too confusing. Anyways.. I have looked around and the only ways I can see to counter this issue.. is to calculate the position of the object at a given time and then just keep updating the statelite given the time.. or to only move the object a tiny amount of distance but increase or decrease the programs frame rate dependent on the satellites velocity.
I am sure there must be some solution to this as I have seen many good simulators (even tho not many are willing to share code)..
Any help would be sooooooo grateful...