I'm programming a small computer game and have run up on the following math problem:
Two objects exist on a two dimensional space. One is a moving target, the other is a stationary shooter, firing at the target. Assume that I know all of the following:
The exact location of the shooter and the target at any given point in time.
The distance between the shooter and the target at any given time.
The velocity and direction of motion of the target.
The velocity of the projectile. (constant velocity)
All conditions are ideal: no friction, no changes in velocities or directions, no wind resistance, etc.
How can I determine what direction the shooter should fire in to hit the target at any given time?
I've been racking my brain for a couple of days, and can't figure this one out. Any help is greatly appreciated.
2006-07-07
13:39:17
·
4 answers
·
asked by
marbledog
6
in
Science & Mathematics
➔ Physics
I know the travel time will be equal for both the target and the projectile, and I can visualize how to do it on paper. What I can't figure out is how to do it using a formula, which I need so I can code it properly.
2006-07-07
13:57:54 ·
update #1