## Intercepting a target

Member
Posts: 43
Joined: 2009.10
Post: #1
So I have a question about how to compute the interception point of a target. The details are as follows:

A target is at position P1 moving along a velocity vector (2D) V1.
A projectile needs to be shot out to intercept the target. The projectile starts at P2 and has a velocity magnitude of |V2|. So the question is, where is the point of interception, provided one exists?

Here is where I'm getting stuck, essentially you can use the law of sines as described by the sub torpedo article on wikipedia:
http://en.wikipedia.org/wiki/Torpedo_Data_Computer

Essentially if you let alpha be the angle between the vector of the target velocity and the initial positions of the projectile and target, then you can compute beta, which is the angle between the position vector and vector which the projectile should be shot along:

beta = arc sin(|v1| / |v2| * sin(alpha))

Then using beta you can compute what the actual component vector is of the projectile vector (making adjustments for orientation as necessary).

Here is the problem I have though: the only solutions this technique gives is for when beta < 90 degrees. However, there should be some cases where beta is > 90 (i.e. the projectile has to almost move with the target and exploit the fact that it starts off ahead to intercept it). So this solution is incomplete.

So, how can I solve this problem in a way that finds solutions where beta would be > 90 degrees?

The other approach I'm thinking of doing is an iterative optimization of a of error function, but it'd be nice if there was a straightforward solution.

Thoughts?
Member
Posts: 43
Joined: 2009.10
Post: #2
Hmmm as I think about this more, now I'm wondering if that is even possible. Maybe I'm wrong that beta could conceivable be > 90 degrees. I think I may have a proof I'm forming that show that it cannot be greater than 90 or it is impossible to catch, but does anyone know for sure to double check me?
Sage
Posts: 1,487
Joined: 2002.09
Post: #3
We wrote a blog post about just this thing: http://howlingmoonsoftware.com/wordpress/?p=358

The solution I show uses only a few dot products and a single square root. I usually try to avoid using inverse trig functions as I often find that I run into obnoxious domain issues and a lot of needless conversions to and from polar coordinates.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Member
Posts: 43
Joined: 2009.10
Post: #4
Cool, I'll check out the link. Thanks.
binfong
Unregistered

Post: #5
yes ~~~~~~~~~~~~~~~~~~~~~~~~