I'm creating a simple astronomy simulator that should use Newtonian physics to simulate movement of plants in a system (or any objects, for that matter). All the bodies are circles in an Euclidean plane, that have properties such as position, velocity, mass, radius and the resultant force.
I want to update the universe in small time steps, usually a few milliseconds, but I'm not sure how to correctly calculate the changes in position.
The force is simple:
fr = sum(G * body.m * bodyi.m / dist(body, bodyi)^2).
But how do I go on from there?
I could do this:
a = Fr/body.m v += a*dt position += v*dt
But that would, of course, be false. Maybe if I added
0.5 as a factor in position calculation?