# projectile trajectories

This is a discussion on projectile trajectories within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I have a question... When something is being fired straight up, you can use these equations to figure out approximately ...

1. ## projectile trajectories

I have a question...

When something is being fired straight up, you can use these equations to figure out approximately where it will land, assuming you are on a 2d plane (not 3d) and the object can be carried by the wind:

Y-Coord = -4.9 ( time ) ^ 2 + (speed of object)( time ) + 4

time = time since projectile was fired. (in seconds)
speed of object = speed when initially fired in meters per sec.

X-Coord = (wind speed)(time)

wind speed is in meters per second.

However, lets say you are firing a bullet into the air, but not at a 90 deg. angle.

How would you go about calculating the angle offset? Anybody have any idea?

2. You use trig. I can explain more in a few hours, but someone will have solved it by then.... Until then you could always look up ballistics on google. Btw, you can calculate it for 3d, too - you just have to add in the z forces.

3. Oh yeah, and I'm thinkin' your y equation's wrong... where's the 4 come from?

4. These equations will work in any direction.

Displacement = (1/2)(Acceleration)(Time^2) + (Velocity(orig.))(time) + Original Displacement

Velocity = (Acceleration)(time) + (Velocity(orig.))

and everyone's favorite:

velocity^2 = (Velocity(orig.)^2) + 2(Acceleration (position 1-position2(displacement)))

What I usually did was solve for the time in one direction, and then used that time, in the other direction, because something can't fall in two different times..ya dig??

Anyway, I'm not sure about adding in the wind displacement maybe that would factor in as a original velocity??? But don't quote me on that one.

Wow..physics is back....RUN FOR YOUR LIVES!!!!!!

P.S. Also be careful with your directions if your y axis is positive UP then gravity would be applying an accel of -9.8 (m/s/s)

5. In symbols:

V = Vo + at
V^2 = Vo^2 + 2ad - or - V^2 = Vo^2 + 2a(X-Xo) (or whatever direction you're talking about)
X = (1/2)at^2 + Vot + Xo

6. > Anyway, I'm not sure about adding in the wind displacement maybe that would factor in as a original velocity??? But don't quote me on that one.

Yeah - wind's just another velocity vector... (Think about it - if you're in a boat and the current's coming at you at 5 mph, and your paddling at 5mph relative to calm water, you go nowhere... same deal)

None of these factor in air resistance, David, which, AFAIK is just the resistance the object encounters due to wind... I have no idea waht the coeffecientof friction would be for that or how to find it...

7. Ya, you can just use trig & the angle of firing to get the x and y component velocities.
maximum horizontal distance is achieved with a firing angle of 45 degrees above horizontal, negating air resistance. Including air resistance (p ->pronounced row?) it is something like 30 degrees if I remember correctly.

8. >where's the 4 come from

Sorry...forgote to change that...that should be the original height of the object.