Get Projectile hit moving target

  • Thread starter Thread starter calthabis
  • Start date Start date
  • Tags Tags
    Projectile
Click For Summary
The discussion focuses on calculating the angle needed for a projectile to hit a moving target in a 2D space, considering factors like gravity and the target's constant y-coordinate. The user seeks a formula to determine this angle given the projectile's initial speed, height, and the target's speed towards it. Participants suggest setting up equations for the projectile's and target's positions over time, leading to a system of equations that can be solved for time and angle. They recommend using symbolic math software or numerical solvers to handle the complexity of the equations, as manual solutions may be cumbersome. The conversation emphasizes the importance of computational tools in solving such projectile motion problems effectively.
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:
For simple comparison, I think the same thought process can be followed as a block slides down a hill, - for block down hill, simple starting PE of mgh to final max KE 0.5mv^2 - comparing PE1 to max KE2 would result in finding the work friction did through the process. efficiency is just 100*KE2/PE1. If a mousetrap car travels along a flat surface, a starting PE of 0.5 k th^2 can be measured and maximum velocity of the car can also be measured. If energy efficiency is defined by...

Similar threads

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