aw_barron
- 3
- 0
Hello. I've got a simply ballistics program with a very simply algorithm to deal with air friction. However, I am trying to find a mathematical forumula equivalent. Here is the algorithm:
G = accel due to gravity (universal constant)
F = projectile air friction factor (constant for a given projectile)
T = delta T (delay between loops, varies depending on frame rate but is about 0.01)
Projectile starts out traveling at velocity Vo fired at angle Ao.
Velocity is broken into a vector made up of: Vx and Vy
Loop
Ax = Vx * F
Ay = Vy * F * G
V = [Vx*Ax*T, Vy*Ay*T]
Wait T
goto Loop
For any given projectile, I will know Vo and F.
For now, I want an equation where I can specify a point (x,0), and it will give me the required Ao so that the trajectory intersects that point.
Basically, given a specific distance, I want to know the angle required in order to land the projectile there (assuming the ground is flat and projectile is fired from y=0).
I the approach I'm trying to take is to find equations that give the projectile's current position (x,y) based on the variables Vo, Ao, and F, and the constant G. I can do this easily in an Excel spreadsheet, but I'm not sure how to do it in an equation.
I've come up with an acceleration forumula: Ax = Vx^2*F
Basic physics says that velocity is the integral of acceleration. However, I'm confused about if/how I can integrate this, since acceleration depends on velocity.
Can anyone help me out here? Thanks!
G = accel due to gravity (universal constant)
F = projectile air friction factor (constant for a given projectile)
T = delta T (delay between loops, varies depending on frame rate but is about 0.01)
Projectile starts out traveling at velocity Vo fired at angle Ao.
Velocity is broken into a vector made up of: Vx and Vy
Loop
Ax = Vx * F
Ay = Vy * F * G
V = [Vx*Ax*T, Vy*Ay*T]
Wait T
goto Loop
For any given projectile, I will know Vo and F.
For now, I want an equation where I can specify a point (x,0), and it will give me the required Ao so that the trajectory intersects that point.
Basically, given a specific distance, I want to know the angle required in order to land the projectile there (assuming the ground is flat and projectile is fired from y=0).
I the approach I'm trying to take is to find equations that give the projectile's current position (x,y) based on the variables Vo, Ao, and F, and the constant G. I can do this easily in an Excel spreadsheet, but I'm not sure how to do it in an equation.
I've come up with an acceleration forumula: Ax = Vx^2*F
Basic physics says that velocity is the integral of acceleration. However, I'm confused about if/how I can integrate this, since acceleration depends on velocity.
Can anyone help me out here? Thanks!