PDA

View Full Version : Parabolic trajectory problem



Sir Realism
May 18th, 2009, 03:48 PM
Dear readers,

I have an extremely complicated mathematical problem which I just can't get my head around.
What I want is a system that makes one person aim at another person while his cannons bullets fly like mortars, so in a parabolic curve. In this situation I know:

- The distance between me and my enemy
- My cannons firepower
- Gravities strength

Of course I know more, but I think these are the only relevant things.
I found a wikipedia article explaining my problem, but I haven't done university in maths (yet), so I don't understand anything about it: http://en.wikipedia.org/wiki/Trajectory

If the effect I want to have is not clear then here's an example: http://dan-ball.jp/en/javagame/ranger/ (http://dan-ball.jp/en/javagame/ranger/)The archer (Sniper) in this game (Stick Ranger) can hit the enemies with his bow in a certain arch. I want that too!

All I need is to know is the angle needed to get the cannonball to hit my enemy!
Ow...It should be done in AS2...

I really hope someone can help me with this!

Cheers,

~Sir Realism

substance
May 19th, 2009, 05:38 AM
http://jobemakar.blogspot.com/2008/01/predictive-shooting.html

Charleh
May 19th, 2009, 06:02 AM
A really useful site for this is

http://hyperphysics.phy-astr.gsu.edu/Hbase/traj.html

Check out a bit further down, there's some javascript boxes which allow you to work out values - then you can rework the maths for your program and test to see if you get the same values.

Sir Realism
May 19th, 2009, 09:34 AM
Thanks guys! ^^