Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculating Intercepting Vector

Tags:

c#

math

vector

I have 2 objects (i'll refer to them as target and interceptor). I know the target's current location and velocity. I know the interceptor's current location and speed it can travel.

From that, what I now need to know is :

  • Is interception possible ie same location at same point in time.
  • What vector would the interceptor need to travel on
  • How much time will the interception take

i.e target @ (120,40) with a V(5,2) per second and interceptor @ (80,80) that can travels with a speed of 10 per second.

I've looked around and found plenty of ways to find out what point they meet and they all revolve around the angle between the two vectors and as I don't know the second vector and I can't calculate that and I'm getting lost trying to resolving this.

Any suggestions or guidance on how to proceed are appreciated.

like image 714
MikeT Avatar asked Dec 02 '22 14:12

MikeT


1 Answers

You can compute the intersection with a 2D vector calculation. The target moves along a line. We know the starting point of the target, its direction and speed.

At any time t >= 0 the target is at point x defined by

enter image description here

where s_t is the starting point of the target (120, 40) and v_t is the velocity vector of the target (5, 2).

We know the interceptor's starting point (s_i), its speed (v_i), but not its direction. We can describe the interceptors range by a circle around the starting point, whose radius increases over the time. In vector calculus we get

enter image description here

where x is a point on the circle, s_i is the starting point of the interceptor (80, 80), r is the radius (or range) of the interceptor at time t, and v_i is the speed of the interceptor (10).

When the target and the interceptor meet at time t, their location x must be equal. We use the x of the line equation in the x of the circle equation and get

enter image description here

That's just a normal quadratic equation for t:

enter image description here

You can easily solve this. In this case you get a valid and an invalid solution:

t1 = -5.2328 => invalid because t must be >= 0

t2 = 8.61307

Now that you know t, you can compute the intersection point with the first line equation. Target and interceptor meet at (163.065, 57.223)

like image 189
gdir Avatar answered Dec 24 '22 21:12

gdir