What are some algorithms that will allow me to simulate planetary physics?

前端 未结 12 569
离开以前
离开以前 2021-01-30 17:37

I\'m interested in doing a \"Solar System\" simulator that will allow me to simulate the rotational and gravitational forces of planets and stars.

I\'d like to be able t

12条回答
  •  攒了一身酷
    2021-01-30 18:15

    All you need to implement is proper differential equation (Keplers law) and using Runge-Kutta. (at lest this worked for me, but there are probably better methods)

    There are loads of such simulators online.

    Here is one simple one implemented in 500lines of c code. (montion algorhitm is much less) http://astro.berkeley.edu/~dperley/programs/ssms.html.

    Also check this:
    http://en.wikipedia.org/wiki/Kepler_problem
    http://en.wikipedia.org/wiki/Two-body_problem
    http://en.wikipedia.org/wiki/N-body_problem

提交回复
热议问题