Fire projectile to hit a moving object

  • Context: Undergrad 
  • Thread starter Thread starter RuneStrife
  • Start date Start date
  • Tags Tags
    Fire Projectile
Click For Summary

Discussion Overview

The discussion revolves around calculating the angle to shoot a projectile to hit a moving target in a simulation project. Participants explore the dynamics involved when both the shooter and the target are in motion, including the effects of their respective velocities and the need to lead the target.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant describes the scenario where a projectile is shot from a moving gun at a moving target, emphasizing the need to calculate the angle to account for both velocities.
  • Another participant suggests simplifying the problem by considering the gun's origin as stationary and adjusting the target's velocity accordingly, separating it into x and y components for analysis.
  • A participant shares their approach of calculating the intersection time by treating the gun as stationary and deriving a quadratic equation based on the target's distance over time.
  • One participant references missile guidance methods as a potential solution, providing a link to an article that discusses relevant geometrical concepts.
  • A later reply indicates that a solution was found using a specific equation involving position and velocity vectors, and discusses the transition to comparing normal and directional inheritance of velocity in the projectile's motion.
  • The same participant questions the correctness of their modified vector components for the gun's velocity and seeks further assistance on how to proceed with their calculations.

Areas of Agreement / Disagreement

Participants express various approaches to the problem, with no consensus on a single method or solution. Multiple competing views and methods remain present throughout the discussion.

Contextual Notes

Participants mention the complexity of the problem due to the interdependence of the projectile's speed and the angle of fire, as well as the need for vector addition to resolve the dynamics accurately. There are unresolved mathematical steps and assumptions regarding the projectile's motion and inheritance of velocity.

RuneStrife
Messages
3
Reaction score
0
This is not a homework problem so i didn't post it in that section, however, it is homework-problem-ish in that it's a problem for a non-school-related programming simluation project I'm working on that I can't solve. If appropriate, please move to that section.

Overview: I'm working on programming a simulation that requires 'shooting' projectile-type objects at other moving objects. How can I calculate the angle at which to shoot the object to hit?

Details:

Imagine you're holding some gun-type object that shoots projectiles at velocity Vd in straight lines. You are moving with Speed Vp at angle Theta_p, in a straight line. Another object, which we will name the target, is located a distance R away from you at an angle Theta_tp, and is moving in a straight ine with velocity Vt at angle Theta_t.

I need to calculate the angle Theta_a I should aim the gun in order to hit the target. The target is moving so you need to lead it with your shot to compensate. Also, the projectile will inherit your velocity on top of its own since you are also moving, which will further modify the angle you need to shoot at.

It seems to me that the strategy should be that I find a point in space which will be occupied by both the projectile and the target. I know all the points in space that the target will take along its linear path, and the times at which it will take all points. However, because the total velocity of the projectile varies based on the angle you shoot it (e.g. the magnitude of the velocity vector will be different depending on what Theta_a you decide to shoot at), I'm not sure how to figure out where to shoot it.

Any help would be appreciated!

In addition, if it is easy, a solution to a target moving in a circular path with radius R (same R as the distance between you and it, so it's making a perfect circle around you) would be appreciated!

Thanks!
 
Physics news on Phys.org
Pretend as though your origin is stuck to the gun, add the negative of the guns velocity to the target (same magnitude, just reverse direction), this really will simplify things for you.
Now you can separate the target's velocity into an x-component (V_{target}\cos \theta_{target}) and a y-component (V_{target}\sin \theta_{target}) and solve these simultaneously with the "bullet's" motion relative to the gun.
 
Thanks for the reply. In fact this has been exactly my approach so far. Before posting this message, I've been able to figure out how to hit a moving target while gun is stationary by doing the following:

1. Figure out the length of the radius between target and gun as a function of time, where gun is always at the origin and not moving.

2. I can then divide that by the magnitude of projectile speed to get a quadratic that gives the time of intersection with the target and get the angle of R at that time.

My problem is that when the gun moves, the magnitude of the projectile speed would vary as a function of the angle you shoot at, because it would inherit the gun's velocity vector (constant angle) plus its own velocity (at the angle to aim) so to calculate the gun's velocity magnitude I'd need to already have the angle I'm looking for.

However, after some thinking I'm going to try to redo the problem through vector addition instead of converting stuff to scalar magnitudes and such, which may (or may not) simplify things.
 
I think your problem of intercepting a moving object can be solved by using the methods of missile guidance trajectories. Here is an article you may be able to use. See:

http://www.jhuapl.edu/techdigest/TD/...mbo_Homing.pdf

“Figure 2. Planar engagement geometry. The planar intercept problem is illustrated along with most of the angular and Cartesian quantities necessary to derive modern guidance laws.”
 
Actually i was able to solve the problem using the equation:

|T-G-t*(VT-VG)|=D*t

where T and G are target and gun position vectors, VT and VG are velocity vectors for target and gun, D is the projectile default velocity, and || is the magnitude of the sum of those vectors (add the x and y components as above, square them, add that, take the square root, divide by D).

This should give me t to intersect, and then I can plug that into those X and Y components (from the equation above) and take the atan() of those to get the angle.

Now I moved onto the next step of the problem which is to compare normal inheritance to Directional inheritance, defined such that the projectile only inherits the projection of the gun's velocity on the vector along which it is fired (which is not the vector along which it moves).

Any help with this would also be appreciated. Currently I've modified the vector components in the above equation such that VP components have been changed from:

(VG*cos(Theta_G)i, VG*sin(Theta_G)j)

to:

(VG*cos(Theta_T-Theta_G)^2)i, (VG*cos(Theta_T-Theta_G)sin(Theta_T-Theta_G))j

where Theta_T is the angle defined by the radius drawn from (0,0) to the target and Theta_G is the same thing for the gun.

Does this seem correct, and if not, how to proceed?
 
Last edited:

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 28 ·
Replies
28
Views
4K
Replies
1
Views
1K
  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K