Calculate Projectile flight time based on Gravity

mathematical physicsphysicsprojectile motionvectors

Hey I want to calculate the flight time of a Projectile in 3D Space based on Bullet's speed, Velocity, Acceleration and Gravity or a custom downward force.

I already have a formula that calculates the time it takes a bullet to intercept another moving target depending on the bullet's position, the target's position, the bullet's speed, the target velocity, and the target acceleration which looks like this:

a = Acceleration
v_T = Target Velocity
p_T = Bullet Impact Position - Bullet Start Position
s = Bullet Speed

  t^4 * (a·a/4)
+ t^3 * (a·v_T)
+ t^2 * (a·p_T + v_T·v_T - s^2)
+ t   * (2.0 * v_T·p_T)
+       p_T·p_T
= 0

However, this would give me the time it takes for the Bullet to reach the Target, without the impact of Gravity or any downward force, assuming the Bullet travels in a straight path.

But I want to calculate the time it takes the bullet to reach the target using gravity which lets the Bullet travel in a curve (you shoot above the target to compensate the gravity).

Since my math skills are unfortunately not the best, I hope that someone can help me here. What would the formula look like to be able to calculate the Travel Time if the factors were the following:

  • Bullet's speed: 150 M/s
  • Gravity: 10 M/$\text{s}^2$
  • Bullet Start Position: Vector3D$\space$ (0,0,0)
  • Targets Position: Vector3D$\space$ (200,0,0)

Target acceleration and target velocity do not matter in this case.

Best Answer

Projectile

The path traced by a bullet travelling under the influence of the force of gravity is called a parabola. This force acting on a projectile (or bullet) confine its trajectory to a 2D vertical plane, which is shown in the diagram. In general, a bullet fired with a given velocity can hit a given target while either rising (green trajectory) or plummeting (red trajectory). The travel times of the two instances to reach the same target are not equal. Besides, their launch angles are different too.

We denote the speed of the bullet, the angle of its projection, its travel time, and the force of gravity by $v$, $\theta$, $t$, and $g$ respectively. furthermore, the coordinates of the bullet's firing point $B$ and the target $T$ are taken as $\left(x_0, y_0, z_0\right)$ and $\left(x_1, y_1, z_1\right)$ respectively. With that, we can state, $$d=\sqrt{\left(x_1 - x_0\right)^2+\left(y_1 - y_0\right)^2}\quad\text{and}\quad h = z_1-z_0.\tag{1}$$

Using laws of motion under the influence of gravity, we can express $t$ and $h$ in terms of the unknown $\theta$ as shown below.

$$t=\dfrac{d}{v\cos\left(\theta\right)}\tag{2}$$ $$h = v\sin\left(\theta\right)t - \dfrac{1}{2}gt^2\tag{3}$$

Equation (2) shows that the bullet launched with the smaller angle needs shorter travel time to reach the target.

When we eliminate $\theta$ from (3) using (2), we get the following expression for $h$ in terms of $t$. $$h = vt\sqrt{1-\dfrac{d^2}{v^2t^2}} - \dfrac{1}{2}gt^2$$

This can be simplified and rearranged to obtain the following quartic equation in $t$. $$g^2t^4-4\left(v^2-hg\right)t^2+4\left(h^2+d^2\right)=0\tag{4}$$

The travel times $t_1$ and $t_2$ are the two positive real roots of (4). They can be written as, $$t_1=\sqrt{2}\sqrt{a+\sqrt{b}}\quad\text{and}\quad t_2=\sqrt{2}\sqrt{a-\sqrt{b}},$$ $$\text{where}\quad a=\dfrac{v^2}{g^2}-\dfrac{h}{g},\quad\text{and}\quad b=a^2-\dfrac{h^2+d^2}{g^2}.$$

The corresponding angles of firing are given by, $$\theta_1 =\cos^{-1}\left(\dfrac{d}{vt_1}\right)\quad\text{and}\quad \theta_2 =\cos^{-1}\left(\dfrac{d}{vt_2}\right).$$

Before attempting to determine the travel time, we need to make sure whether the bullet can reach its target. It reaches the target if and only if, $$h\le \dfrac{1}{2}\left(\dfrac{v^2}{g}-\dfrac{d^2g}{v^2}\right).$$

If both the firing point and the target are located on the same lavel, i.e. $h=0$, travelling time can be calculated using the following set of equations. $$t_1=\sqrt{2}\sqrt{a+\sqrt{b}}\quad\text{and}\quad t_2=\sqrt{2}\sqrt{a-\sqrt{b}},\quad\text{where}\quad a=\dfrac{v^2}{g^2},\quad\text{and}\quad b=a^2-\dfrac{d^2}{g^2}$$

For this special case, the following relationship between $\theta_1$ and $\theta_2$ holds. $$\theta_1+\theta_2 = 90^{o}$$

When the given values $d=200m$, $h=0m$, $v=150\dfrac{m}{s}$, and $g=10\dfrac{m}{s^2}$ are substituted in the above equations, we get, $$t_1 = 1.334654779\qquad\text{and}\qquad\theta_1 = 2.549844457^{o}\quad\text{and}$$ $$t_2 = 29.9702969\qquad\enspace\text{and}\qquad\theta_2 = 87.4501555^{o}.\quad\qquad$$