# Homework Help: Calculating the Angle of Projection

1. Dec 31, 2009

### Archer2338

1. The problem statement, all variables and given/known data

Well, I was trying to find an equation that would let me calculate what angle I have to put my gun at to get the projectile to hit a specified distance. Not actual homework, but something I'm trying to do for a game (Garry's mod)

So the initial velocity of the shell (Muzzle velocity), gravitational acceleration, and range is known.

2. Relevant equations

I found this off wikipedia:

θ= 1/2 arcsin(G*R/V^2)
With G being gravitational pull, R being the range, and V being the initial velocity.
Problem is, that does not take into account air resistance in the game, which does affect the shell I am firing.

3. The attempt at a solution
See above... So I used that equation, but the shell falls short of its target, meaning that air resistance is slowing it down. How would I calculate the angle of projection to launch a shell R distance with air resistance?

Also, I doubt the game calculates air resistance extremely realistically. It would probably look like this:
(de)Acceleration due to air res. = (Velocity^2*Offset)/Mass of shell
with Offset being some constant that stays the same regardless of the mass of the shell.

Signed up for this forum for this question, and I would be very thankful to anyone that replies.

2. Dec 31, 2009

### pgardn

In reality it is a bit complicated. I might look here.

http://en.wikipedia.org/wiki/Drag_(physics [Broken])

The problem is with air resistance is it varies with velocity, the faster you go, the harder the air pushes. And it depends on property of the fluid (in this case air) and the object.
So you have to make a guess what the programmers decided as you did. If they decided to use some physics then the wiki article explains some of the complexities.

Last edited by a moderator: May 4, 2017
3. Jan 1, 2010

### Archer2338

Okay, I did a little bit of more digging around. The equation used is:

frontal area of the bullet * velocity^2)/Constant

So I don't know whether this equation only applies to the bullet when it leaves the barrel and slows the same amount each time, or the drag force changes during the bullet's trajectory.

How would I apply those into the base non-air resistance equation? I assume I would be able to find the velocity of the bullet, both estimated and real time (tracking the bullet itself), but how would I incorporate that drag equation to find out the angle I need to hit something at X distance?

Last edited by a moderator: May 4, 2017
4. Jan 1, 2010

### pgardn

That equation should have some variable involving time. If it is a measure of the force of the air on the bullet or the acceleration, those would change through time due to air resistance based on velocity squared.

On the second part you might have to experiment. You could aim straight at the target and see how far below you miss. Then you know how much below the target it fell so you might be able to use that to know how far above you need to aim. ON the other hand, if you did adjust this way, you would most likely spend more time in the air so that would mess everything up...

You really need to stick this back into the kinematics equations in the horizontal since air resistance would play the biggest role in the horizontal. In other words you would have acceleration in the vertical from gravity (and a little bit from air presumably) and in the horizontal (all from air resistance). In the simple projectile problems air resistance is left out of the horizontal motion.