- #1

SirHall

- 22

- 1

To find the firing angle to hit a target at a given distance using the initial velocity and gravitational acceleration, we use the formula:

Angle = Firing

XDist = Distance the target is from the gun along the X axis

YDist = Distance the target is from the gun along the Y axis

Angle = radtodeg(arctan((power(Velocity, 2) + sqrt(abs(power(Velocity, 4) - Gravity * (Gravity * power(XDist, 2) + 2 * YDist * power(Velocity, 2))))) / (Gravity * XDist)))

However, I am trying to figure out a way to tell the formula to also account for drag/air friction. My main attempt was to add the distance the projectile loses to the XDist and YDist values, however I think that my scripts aren't exactly correct.

Any help would be greatly appreciated.

Angle = Firing

XDist = Distance the target is from the gun along the X axis

YDist = Distance the target is from the gun along the Y axis

Angle = radtodeg(arctan((power(Velocity, 2) + sqrt(abs(power(Velocity, 4) - Gravity * (Gravity * power(XDist, 2) + 2 * YDist * power(Velocity, 2))))) / (Gravity * XDist)))

However, I am trying to figure out a way to tell the formula to also account for drag/air friction. My main attempt was to add the distance the projectile loses to the XDist and YDist values, however I think that my scripts aren't exactly correct.

Any help would be greatly appreciated.