I searched for quite some time to find a good mathematical solution for my cannon firing a projectile at a moving target, taking into account gravity. I found a solution to determine the angle at which the gun should be fired, based on the position of the gun, the position of the target and the speed of launch. The formula is described here: http://en.wikipedia.org/wiki/Trajectory_of_a_projectile#Angle_.CE.B8_required_to_hit_coordinate_.28x.2Cy.29 .

It works great. However, my target is moving, so if I shoot at the target and the projectile takes a few seconds to reach the destination, the target has long been gone. Target position x can be determined from a point in time. Suppose that: x = 1000 - (10 * t) , where t is the time in seconds. Y can be described as: y = t .
The problem is that t depends on the angle at which the gun starts.
So my question is: how can I change the formula as described in the wiki so that it takes into account the moving target?
Also, maybe I was looking for the wrong words here or on Google, but I could not find a solution describing this exact problem.
Thank you in advance for your gap!
. , . , , .
:
{0, 0} .
100 /.
{1000, 0} 10 / (v = -10 /).
, t = 0 ()?
, {1000, 0}, . , .
, , {500, 0}, , , ( 5 ) , 5 {500, 0}, {550, 0}. , 450 45 , . , .
, . - , , "" " ", .