|
|
#1 | |
|
Spun a twirly fruitcake,
Join Date: Feb 2009
Age: 33
Posts: 3,876
|
Hi,
I've been working on some formulas in case I would ever need to make game AI; now I'm stuck. First of all, a pathetic paint construction: ![]() Now if you say C is an archer standing on a 10 meter high city wall and A is an object it wants to shoot. At what angle X must the archer shoot to hit A? We can assume that the speed of an arrow is 60 m/s and is not affected by drag (i.e. the horizontal speed is constant) and that gravity works at 9,81m/s^2 (only vertical, no curvature of the earth). What I figured out so far is: - Vertical arrow speed = sin ∠X * 60 m/s - Horizontal arrow speed = cos ∠X * 60 m/s - Time it takes to reach its maximum height = sqrt(sin ∠X * 60)/9,81 - Distance the arrow travels from C to D: 2(sqrt(sin ∠X * 60)/9,81) * (cos ∠X * 60) What I haven't figured out: - The formula for the maximum height in meters. - The formula for the horizontal distance travelled from point D to point A. - END: The formula for the angle at which C must shoot. So far I've brainfarted about 5 times on the easiest things. Now I have a headache and the idea that I'm approaching this problem completely wrong and have to start all over. Even if you only give the formula on rough paper, I'll be well satisfied. Thanks in advance, Scintill
__________________
Quote:
|
|
|
|
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|