Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » General Discussions » General Discussion » A math question.
Re: A math question. [message #256827 is a reply to message #256631] Wed, 02 May 2007 14:04 Go to previous messageGo to previous message
Doitle is currently offline  Doitle
Messages: 1723
Registered: February 2003
Location: Chicago, IL
Karma:
General (1 Star)
Moderator/Captain

Jerad Gray wrote on Tue, 01 May 2007 12:15

Can anyone give me a formula for how I would calculate what angle an artillery would have to aim at if I knew: gravity, speed of the projectile, distance away the object is from the artillery, height of the object compared to the artillery, and 0 air resistance. This is also for a program, or game more likely *cough*new AI for Renhalo*cough*.


Here you go.

R = d + v*cos(theta)*(v*sin(theta)+SqRt(v^2*.5*(1-cos(2theta))-(2*A*(0-h)))/A)

I'm pretty sure that's the Master Projectile Equation I derived back in Highscool. I still had the prgoram I made for the TI that ran the equation. Basically here's the breakdown. V = your muzzle velocity. Theta is the angle off the horizontal. A is your accelleration constant (e.g. g=9.81m/s^2) H is your initial height. D is your initial X displacement. (How far back from the edge of the cliff you are.

Hope that helps. If you can't make sense of it I'll go put it into math type to make it look a bit prettier.


http://www.n00bstories.com/image.fetch.php?id=1285726594
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon7.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Ohh. Emm. Gee.
Next Topic: Anti Web blocker site?
Goto Forum:
  


Current Time: Mon Nov 18 02:10:14 MST 2024

Total time taken to generate the page: 0.01003 seconds