I am making a simple coding project where a white dot is orbiting another dot. I could not find a mathematical formula to change the speed of the dot based on its movement direction proportional to the gravity. I have not taken physics yet so all of this is still very hard to me. While I know this is not stackoverflow.com, I thought that this issue would we relevant to me in both places. My source code is here: https://jsfiddle.net/L9bxa5km/2/
I know most of you are not coders, so I will break it down for you. The dot moves in a certain direction with a speed. Its angle of movement is affected by gravity to move towards the center. The only issue I have is the need for the speed of the ship to change based on the gravitational pull.