Original Post
The target is heading at a 45 degree angle North-East from coordinates (5,4) at a speed of 7yd/s. Note: coordinates are generic and vary from map-to-map in this game, thus (5,4) does not mean 5 yards East, 4 yards North from the origin. The player is at (11,8) and has a speed of 8yd/s. What heading (in degrees) should the player travel to intercept the target in the least amount of time? Please provide a formula/proof. Bonus points: Compensate for 500ms lag. Bonus points: If the player's movement speed is reduced to 2yd/s then interception of the target is impossible. How does he minimize the distance gap that will inevitably be left? Bonus points: Add Z-Axis coordinates. -- This is not homework. I've been trying to make an addon for a game that improves AI and also gives the player the best heading to intercept a target. Problem? I suck at math. So any help is appreciated. This is an example I've been trying to figure out on my own. Here is some of what I've come up with: P = (Xp,Yp) = Player Coordinate T = (Xt, Yt) = Target Coordinate What we need to do is create a triangle with the line PT, Target vector (Tv), and Player vector (Pv). The Angle of TvPT (that is the angle formed by the Target Vector and line PT) = the Angle of PvPT (that is the angle formed by the Player Vector and line PT) The Inerception point is then where Tv intersects with Pv. The final part is the velocity ratio. If Ps (Player Velcoity/Speed) is twice as much as Ts (Target Velocity/Speed) then the ratio is 2:1. So the angle PvPT is half (i.e. if it was 45 degrees it would be 22.5 degrees). If Ps (Player Velocity/Speed) is half as much as Ts (Target Velocity/Speed) then the ratio is 1:2. So the angle PvPT is twice as much (i.e if it was 35 degrees it would be 70 degrees). The Interception point will still be where Tv intersects with Pv. There will be some cases where Interception is not possible. It could be because the Target moves faster than the Player or Tv is 90 degrees or greater. Knowing all this I am still having trouble coming up with a formula or a function. Again, any help is appreciated.