Get Projectile hit moving target

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

Discussion Overview

The discussion revolves around calculating the angle needed for a projectile to hit a moving target in a 2D space. Participants explore the dynamics of projectile motion under the influence of gravity, considering the target's constant vertical position and horizontal velocity.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Technical explanation

Main Points Raised

  • One participant outlines the problem, specifying the initial conditions of the projectile and the target's motion, and requests a formula for the required angle.
  • Another participant questions whether the problem is too complex or lacks sufficient information for a solution.
  • A third participant suggests writing expressions for the projectile's and target's locations as functions of time, proposing to set these equal to find the collision point.
  • A participant shares their progress, detailing their equations for the projectile and target motion, and attempts to derive a relationship between the angle and time.
  • Another participant advises against solving the equations by hand, recommending the use of symbolic math software or numerical solvers, and notes the complexity of the resulting equations.

Areas of Agreement / Disagreement

Participants express various approaches to solving the problem, with no consensus on a single method or solution. There is acknowledgment of the complexity involved in deriving the angle needed for the projectile to hit the moving target.

Contextual Notes

Participants note the challenge of solving the equations due to the multiple roots produced and the potential for simpler methods that have not been fully explored.

calthabis
Messages
3
Reaction score
0
Hello i need this för a coding project I am currently occupying myself with =)

ok so the system is in a 2D space, the projectile starts at a height H and is supossed to hit target T. the targets y.coord is constant Ty but his x has a speed Tv towards the projectiles start. the target starts at a distance D from the projectile. the projectile has a given starting speed of Pv0 and the angle A.

oh right and gravity is affecting the projectile =)SO! what i need is a formula that can tell what angle I need to hit the target.

Thanks in advance
 
Last edited:
Physics news on Phys.org
Was this too difficult or is there not enough information??
:confused:
 
You can write an expression for the location of the projectile as a function of t and the angle, and you can write an expression for the location of the target as a function of t. Set them equal to each other and you have an equation describing when they collide. That leaves 2 equations in 2 unknowns so you can solve for t and the angle.
 
This is how far I've got. I am stuck so can you please say how i can solve the rest or if there is some other way to solve it.
it might be quite hard to follow on screen so i suggest you follow my calculations on paper.

the target's y coordinate is always 0

Tv = the target's X velocity (speed)
Pv = the projectile's velocity

d0 = the target's x coordinate at t=0
y0 = the projectile's y coordinate at t=0


Pvx = Pv * cosa
Pvy = Pv * sina +gt

Px = Pv *cosa *t
Tx = d0 + Tv *t
Py = y0 + Pv* sina + (g*t^2) / 2
Ty = 0


Tx = Px
Ty = Py


(1.) d0 + Tv *t = Pv *cosa *t
(2.) 0 = y0 + Pv* sina + (g*t^2) / 2


(1.) cosa^2 = ( ( d0 + Tv *t )/(Pv * t) )^2
(2.) sina^2 = (( -y0 -(g*t^2) / 2 ) / Pv)^2


cosa^2 + sina^2 = 1
(1.) + (2.) = 1

( ( d0 + Tv *t )/(Pv * t) )^2 + (( -y0 -(g*t^2) / 2 ) / Pv)^2 = 1
 
You shouldn't try to solve this by hand. You should either plug the equations into a symbolic math package, like Mathematica, or you should solve it numerically. Just for grins I used Mathematica. I had these two equations describing repectively the x and y coordinates of the collision:

T0x + t Tvx == Pv t Cos[a]
2 P0y + g t^2 + 2 Pv t Sin[a] == 0

Solving this simple appearing system for t and a resulted in 8 roots, each one of which was over 100 pages of output.

You could probably solve this a more clever way to get fewer roots and slightly simpler expressions. One typical way is to not solve for the angle but rather the x and y components. But you would never get something truly simple. If you are coding I would recommend using a numerical solver. There are lots of packages available, many for free.
 
Last edited:

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
11K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K