Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6341603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:04:13+00:00 2026-05-24T20:04:13+00:00

I have started to develop unit trajectories for a game server and for now

  • 0

I have started to develop unit trajectories for a game server and for now I’m trying to retrieve the position of a unit at a given time. It is easy when the trajectory is just a straight line, but it is far more complicated when unit chases another unit.

I’ve done flash app to illustrate the problem. Black trajectory is for unit which travels in a single direction. Blue chases black and red chases blue. What I want is to precalculate whole trajectory for blue and red to be able to retrieve their position in a constant time.

Is it possible? Thanks for any help!!

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:04:14+00:00Added an answer on May 24, 2026 at 8:04 pm

    Here’s a paper A classic chase problem solved from a
    physics perspective
    by Carl E. Mungan that solves a particular version in which the chaser is initially perpendicular to the chased object’s trajectory. I believe this is an inessential element of the solution since that perpendicularity disappears along the rest of the trajectory.

    It is an autonomous system of differential equations in the sense that time does not appear explicitly in the coefficients or terms of the equations. This supports the idea that the family of solutions given in the paper is general enough to provide for non-perpendicular initial conditions.

    The paper provides further links and references, as well as a useful search term, “curves of pursuit”.


    Let’s state a slight different, slightly more general initial condition than Mungan’s. Suppose the chased object (“ship”) is initially located at the origin and travels up the positive y-axis (x=0) with constant speed V. The chasing object (“torpedo”) is initially located at (x0,y0), and although instantaneous reorienting directly at the “ship”, also travels at some constant speed v.

    The special case where x0 is zero results in a linear pursuit curve, i.e. a head-on collision or a trailing chase accordingly as y0 is positive or negative. Otherwise by reflection in the y-axis one may assume without loss of generality that x0 > 0. Thus rational powers of x-coordinates will be well-defined.

    Assume for our immediate purpose that speeds V,v are unequal, so that ratio r = V/v is not 1. The following is a closed-form solution (1) for the “torpedo” curve similar to Mungan’s equation (10):

                         (1+r)          (1-r)
                  [ (x/H)          (x/H)      ]
    (y/H) = (1/2) [ -----      -   -----      ]  +  C    (1)
                  [ (1+r)          (1-r)      ]
    

    in which the constants H,C can be determined by the initial conditions.

    Applying the condition that initially the torpedo moves toward the ship’s location at the origin, we take the derivative with respect to x in (1) and cancel a factor 1/H from both sides:

                         r        -r
    dy/dx = (1/2) [ (x/H)  - (x/H)   ]                   (2)
    

    Now equate the curve’s slope dy/dx at initial point (x0,y0) with that of its line passing through the origin:

          r         -r
    (x0/H)  - (x0/H)   = 2y0/x0 = K                      (3)
    

    This amounts to a quadratic equation for positive B = (x0/H)^r:

    B^2 - K*B - 1 = 0                                    (4)
    

    namely B = [K + sqrt(K^2 + 4)]/2 (but use the alternative form if K < 0 to avoid cancellation error), which allows H to be determined from our knowledge of x0 and r:

    H = x0/(B^(1/r))                                     (5)
    

    Knowing H makes it a simple matter to determine the additive constant C in (1) by substituting the initial point (x0,y0) there.


    The tricky part will be to determine which point on the “torpedo” trajectory corresponds to a given time t > 0. The inverse of that problem is solved fairly simply. Given a point on the trajectory, find the tangent line at that point using derivative formula (2) and deduce time t from the y-intercept b of that line (i.e. from the current “ship” position):

    t = b/V                                              (6)
    

    Therefore determining (x(t),y(t)) where the “torpedo” is located at a given time t > 0 is essentially a root-finding exercise. One readily brackets the desired x(t) between two x-coordinates x1 and x2 that correspond to times t1 and t2 such that t1 < t < t2. A root-finding method can be used to refine this interval until the desired accuracy is achieved. Once a fairly small interval has been refined, Newton’s method will provide rapid convergence. We can look at the details of such a procedure in a next installment!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used to develop/debug Javascript on Windows with Visual Studio. Now, I have started
Hello I started trying to develop Android applications today, but I have a problem:
I have just started android development 3 days ago and I'm trying to develop
I have started coding an FTP client application (for fun). I’m trying to represent
I have started to develop a web app on google's app engine and i
I have recently started to develop applications for iPhone with MonoTouch and have to
So i just started trying to develop a simple webpart today for a sharepoint
I have started to think in RoR as an option to develop my applications,
I have started to develop E-Learning application and want to know Are There any
I started develop a distributed application and we have a big dilemma! We need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.