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 :
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.
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
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
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
That's just a normal quadratic equation for t:
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With