Author Question: Can I determine exactly how much a marksman should lead a moving target? (Read 856 times)

Sandstorm

  • Sr. Member
  • ****
  • Posts: 268
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.
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.



camila

  • Hero Member
  • *****
  • Posts: 705
yes, here it goes:

Find the line the target moves on, then draw a line from the shooter dead straight, until it crosses the path of the target.  Then, use the velocities to determine where both the arrow and the target have exactly the same amount of travel time to the point.  Fire the arrow at the cross of the 2 paths when the target reaches its point where it will take exactly the same amount of time to reach the point as the arrow.



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question

federox

  • Sr. Member
  • ****
  • Posts: 308
determine time it takes for projectile to reach target (distance/speed), where the target will be after that time, and aim there.

If the target moves to/from the shooter, the distance travelled by the projectile will be different from what you assumed in the beginningso you might want to repeat the calculation one more time, or keep doing it untill convergence.



Jones

  • Full Member
  • ***
  • Posts: 145
Two ways to approach this.  One you may not have considered.  If your shooter is fixed, and your target is on a plane (x,y), what you may want to try is a change of coordinate.  This problem becomes fairly simple in polar coordinates, as the velocity of the projectile will depend on only one dimension.  The free parameter is simply the angle to 'aim' the projectile.  Anyhow, to solve this you integrate the velocities to get position equations.  Express each in terms of t, set equal to each other, then solve for the free parameter.  I would do it for you, but the procedure requires a analytic expression of the velocity.  Besides, if you follow the above, you can do it easily yourself.



curlz

  • Hero Member
  • *****
  • Posts: 538
ok the formula

if d1 is the distance between the shooter and the bullet
vb is the speed of the bullet
vt is the speed of the target
p1 is the targets original position
p2 is the targets new position when firing
you want to find p2

so vb/d1 will give you the time the bullet takes to get to the person

so you use that time and the velocity of the person to see how far they have gone from the origin, p1, and that is where the bullet should hit

p2 = (vb/d1)vt + p1



 

Did you know?

A serious new warning has been established for pregnant women against taking ACE inhibitors during pregnancy. In the study, the risk of major birth defects in children whose mothers took ACE inhibitors during the first trimester was nearly three times higher than in children whose mothers didn't take ACE inhibitors. Physicians can prescribe alternative medications for pregnant women who have symptoms of high blood pressure.

Did you know?

Never take aspirin without food because it is likely to irritate your stomach. Never give aspirin to children under age 12. Overdoses of aspirin have the potential to cause deafness.

Did you know?

Amphetamine poisoning can cause intravascular coagulation, circulatory collapse, rhabdomyolysis, ischemic colitis, acute psychosis, hyperthermia, respiratory distress syndrome, and pericarditis.

Did you know?

The B-complex vitamins and vitamin C are not stored in the body and must be replaced each day.

Did you know?

The first-known contraceptive was crocodile dung, used in Egypt in 2000 BC. Condoms were also reportedly used, made of animal bladders or intestines.

For a complete list of videos, visit our video library