# Odd Trigonometry Problem

I've been given a problem by a chap on another forum, to do with making a computer game.

The guy wants a missile pre-aim system (a little like clay pigeon shooting), where the target's angle in degrees and speed in pixels-per-frame are used in conjunction with the missile's own speed to predict what angle the missile must fire at in order to collide with the target.

My system works, but it involves computing the future target and missile positions inside the missile (in its private variables) to find a point where the distances are close enough for a hit. Then it just finds the angle between those future positions and fires at that angle.

However, I was thinking, there must be some way to do it mathematically, surely?

Ultimately, at the end of the colision, we'll have a nice neat triangle. Before the missiles start moving, we already know the distance between the shooters (the adjacent), the angle of the target (angle between hyp. and adj.), and the lengths of the hypotenuse and opposite in relation to each other (the speed of the missile vs the speed of the target).

Using this data, could a mathematical formula more efficient than my 'process-of-prediction' be developed to determine:

- What angle the missile must fire at to colide with the target and therefore create a complete triangle.
- If, given the speeds of the missile and target, a colision is actually possible (if the target goes too fast at the wrong angle, it will be impossible for the missile to strike it).

Any thoughts, oh wise math people? :)