Every entity in the universe have an special force that depend on the Universal Gravitational Law. I have created a 3D Simulation in Unity 3D where you can watch the interaction between different mass objects and the elliptical and parabollic trayectories they made.
The elliptical trayectory can be dercibed here. The Sun is in one of the two focus of the ellipse.
The formula for the gravitational force is:
Each entity will suffer the gravitational force of the star. It’s directly proportional to of their masses and inversively proportional to distance of the star. The reason why the vectorial formula has a minus sign is because it’s an attractive force. $u_r$ is the unit vector that connects the star with each planet. $G$ is the gravitational law constant and is $6.67e-11$1