foo_daemon
- 8
- 0
Hi,
I've been muddling over this problem for a few days. I thought there would be a simple approach, but I'm having trouble reaching a solution. Here is the rundown:
We have a 2D projectile launcher. It hurls an object from the origin (0,0) at some initial velocity with magnitude V_i at angle θ with respect to the ground. You will be given its initial velocity, and must choose the launch angle θ such that the projectile will hit a target at point x,H (that is, a point x distance away with height H) during its descent (i.e. anytime after the peak where V_y = 0 ). It is a reasonable assumption that θ will be in the range 0 \leq θ \leq \frac{\pi}{2}.
I am trying to find an explicit formula for θ in terms of V_i , x , H, and the usual g = -9.8 \frac{m}{s^2}
V_{yi} = sin \theta V_i
V_{xi} = cos \theta V_i
We have the following solutions for t:
V_{yi} t + \frac{1}{2} g t^2 -H = 0
V_{xi} t - x = 0
Since we want the projectile to hit the point (x,H) at the same time, we set the equations equal to each other:
\frac {1}{2}g t^2 + ( V_{yi} - V_{xi} ) t + (x - H) = 0
Use the quadratic formula to find t. (I expanded V_{xi} and V_{yi} in the resulting formula so we have θ back in the equation ).
t = \frac{-V_i ( sin \theta - cos \theta ) \pm \sqrt{{V_i}^2 ( 1 - sin{2 \theta} ) - 2 g (x - H)}}{g}
I used trig substitution in the square-root to make a sin^2 + cos^2 = 1 and double angle formula for 2 sin( \theta ) cos ( \theta ) = sin( 2 \theta ) .
I want to factor that nasty expression under the radical by 'completing the square', but I don't see how that is possible.
Also, I don't really want to solve for t ... that is, I don't care how long the projectile takes. All I care about is what angle it needs to be launched at so that it hits point (x,H) .
I've been muddling over this problem for a few days. I thought there would be a simple approach, but I'm having trouble reaching a solution. Here is the rundown:
We have a 2D projectile launcher. It hurls an object from the origin (0,0) at some initial velocity with magnitude V_i at angle θ with respect to the ground. You will be given its initial velocity, and must choose the launch angle θ such that the projectile will hit a target at point x,H (that is, a point x distance away with height H) during its descent (i.e. anytime after the peak where V_y = 0 ). It is a reasonable assumption that θ will be in the range 0 \leq θ \leq \frac{\pi}{2}.
I am trying to find an explicit formula for θ in terms of V_i , x , H, and the usual g = -9.8 \frac{m}{s^2}
V_{yi} = sin \theta V_i
V_{xi} = cos \theta V_i
We have the following solutions for t:
V_{yi} t + \frac{1}{2} g t^2 -H = 0
V_{xi} t - x = 0
Since we want the projectile to hit the point (x,H) at the same time, we set the equations equal to each other:
\frac {1}{2}g t^2 + ( V_{yi} - V_{xi} ) t + (x - H) = 0
Use the quadratic formula to find t. (I expanded V_{xi} and V_{yi} in the resulting formula so we have θ back in the equation ).
t = \frac{-V_i ( sin \theta - cos \theta ) \pm \sqrt{{V_i}^2 ( 1 - sin{2 \theta} ) - 2 g (x - H)}}{g}
I used trig substitution in the square-root to make a sin^2 + cos^2 = 1 and double angle formula for 2 sin( \theta ) cos ( \theta ) = sin( 2 \theta ) .
I want to factor that nasty expression under the radical by 'completing the square', but I don't see how that is possible.
Also, I don't really want to solve for t ... that is, I don't care how long the projectile takes. All I care about is what angle it needs to be launched at so that it hits point (x,H) .
Last edited: