How do I calculate the motion of 2 massive bodies in space?

Posted by 1224 on Game Development See other posts from Game Development or by 1224
Published on 2014-01-25T16:10:50Z Indexed on 2014/05/28 4:08 UTC
Read the original article Hit count: 194

Filed under:
|
|

I'm writing code simulating the 2-dimensional motion of two massive bodies with gravitational fields.

The bodies' masses are known and I have a gravitational force equation. I know from that force I can get a differential equation for coordinates. I know that I once I solve this equation I will get the coordinates. I will need to make up some initial position and some initial velocity.

I'd like to end up with a numeric solver for the ordinal differential equation for coordinates to get the formulas that I can write in code. Could someone break down how from laws and initial conditions we get to the formulas that calculate x and y at time t?

© Game Development or respective owner

Related posts about physics

Related posts about 2d-physics