0

Ok So, I recently checked out Lazy Foo Tutorials for SDL 1.2, and I read the tutorials. I want to program a 2 body problem onto the screen. So where the user enters the data for both body, velocity, mass etc, the distance b/w the bodies and such. After that the bodies start to move on the screen. What I wanted to know was what math would I need to know to program it. I looked into Wikipedia and other sites pertaining to the 2 Body Motion, does the math really need to be as complex as the math that is given on the sites? http://en.wikipedia.org/wiki/Two-body_problem Or could I opt to do a simple Formula of Universal Gravitation http://www.regentsprep.org/regents/physics/phys01/unigrav/Image25.gif and then just after every frame just update the two dots on the screen according to the points given by the formula?

  • This does not look to be related to programming, but math. Try http://math.stackexchange.com/ – olevegard Jan 05 '14 at 21:29
  • Who is the intended audience for this program? (i.e. is this for a game and just has to "look realistic", or is it for NASA and it has to be 100% correct or the spaceship will crash into Mars? ;)) – Jeremy Friesner Jan 06 '14 at 04:13
  • Umm, it's not for Nasa haha, it just has to "look realistic" :D. Just the two bodies circling around each other in an orbit that follow the real life physics behind the two body problem. Any help would greatly be appreciated :P – user3163320 Jan 06 '14 at 16:22
  • In that case, I say start with the simple way. If you don't like how it looks, you can try doing something more elaborate then. – Jeremy Friesner Jan 07 '14 at 01:55

0 Answers0