1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

2D trajectory calculation with constant force

  1. Sep 16, 2015 #1
    Hello folks, I need some physics help.

    Some background to get us on the same rails :)
    I am developing a 2D game in my spare time. Player controls an object (aka spaceship) in open space (no gravitation influence) by selecting a point in space. A constant force which is always pointed at the chosen point is applied to the object. You may read it like this: spaceship's engine with variable thrust vector constantly gives its maximum thrust towards the chosen point.
    Object's mass never changes and stays the same.

    I want to draw a predicted trajectory based on object's current velocity and a chosen point in space. To do that I need to calculate object's position in the future. For example, 10 discreet values - position after 1 second, after 2, 3, ..., 10. It will be enough to draw the line.

    Observable object's behaviour:
    If velocity is > 0 when a point is chosen, object starts orbiting around that point with elliptic orbit. Cool ^^. I just have no clue how to accurately "predict" that motion.

    I revisited kinematic formulas (hello, school), recalled how vectors work (hello again, school) but it seems that this motion is somewhat more complex... I've even looked through some astrodynamics articles on wikipedia but formulas there are for gravitational forces and I cant get my head around them anyway :/
     
  2. jcsd
  3. Sep 16, 2015 #2

    A.T.

    User Avatar
    Science Advisor
    Gold Member

  4. Sep 16, 2015 #3
    Well, it is kinda "elliptic". I mean it is not constant enclosed ellipse but the object orbits in elliptic fashion and never travels further than specific distance.

    And thanks for the link, I'll see if there is what I seek.
     
  5. Sep 17, 2015 #4
    Holy crab, these articles are so freakin' awesome! I have implemented "Runge-Kutta order 4" integration algorithm and it WORKS! It does exactly what I need. I can't thank enough for this link.

    My problem is solved.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook