Originally Posted by
helloworld922
(some long boring math)
t = (x1^2 + y1^2 + x2^2 + y2^2 - 2 * (x1 * x2 - y1 * y2)) / 2 / (xdot1 * (x2 - x1) + ydot1 * (y2 - y1))
Rather than go through the trouble of solving for the other two variables, you can find the intersection point PB from the first set of equations, then compute the angle you need to fire at using the intersection point and the location of tank2.
Isn't that too much math? Both bullets travel on the equal sides of an isosceles and meet each other on the line which indicates the direction of the enemby bullet. If T and E are the points of the tank and enemy respectively, find the point in the middle == (T+E)/2. Draw a line perpendicular to the line ET and find the intersection with the line describing the line traveled by the enemy bullet. That'll be the point of impact of both bullets.
kind regards,
Jos