(I'm a video game developer) I am programming realistic physics, how do I determine the firing angle for the archer to hit its target if the archer and the target are on uneven ground?
You can break the motion of an object shut up at an angle by breaking the initial velocity into x and y components. \(\sf \color{red}{v_{xi} = v_i~cos(\theta)}\) and \(\sf \color{blue}{v_{yi} = v_i~sin(\theta)}\)
Since the veolcty components are independent, and gravity only acts in the \(y\) direction (on an xy-coordinate, obviously), that means that \(v_x\) position is constant. Which means that you can use: \(\sf \color{green}{v_y = v_{yi}+gt}\), where \(\sf \color{green}{v_{yi}}\) = \(\sf \color{blue}{v_i~sin(\theta)}\) as you know, \(g\) = gravity = \(\sf \color{}{9.8 \frac{m}{s^2}}\)
Since gravity does not affect the \(\sf \color{}{v_{xi} }\) there is no need to include difference of gravity.
If you want to know the positions of the cannon ball at any position, you can use either or.
this is of course, ignoring air resistance, as you would be using a slightly different approach with higher math.
This article does a nice job deriving a "general" equation for the range of a projectile. The general case includes height differentials. http://en.wikipedia.org/wiki/Range_of_a_projectile
So what would be the calculation for hitting a target up or down a hill?
Well, that depends on the values that you're using! Duh!
Well, I mean I see the calculation on Wiki, but how would one solve for theta(the angle)?
That calculation is not working out. What I'm doing is firing up or down a hill, thats the calculation I'm trying to find, and Thank You In Advance!!!!
Join our real-time social learning platform and learn together with your friends!