map100-1 default001001.jpg
ballistic trajectory calculator

Ballistic Trajectory (2-D) Calculator

by Stephen R. Schmitt

  Enter parameters:  
vo = meters/second
θ° = degrees
yo = meters
  Results:  
R = meters
h = meters
T = seconds
vf = meters/second

Apply rounding   No rounding


Contents

  1. About
  2. The source code

About

This calculator computes the maximum height, range, time to impact, and impact velocity of a ballistic projectile. Computations are based of the acceleration of gravity on the earth's surface (9.81 m/s/s); atmospheric drag is neglected. The program is operated by entering the initial velocity, initial angle, and height above the surface of the projectile; selecting the rounding option desired, and then pressing the Calculate button. All entries are cleared by pressing the Clear button. If the program returns the error message: cannot solve, then either: the initial angle is outside the range 0 . . . 90°, or the velocity is negative, or a negative value for yo (initial height) results in a negative value of h (maximum height).

Return to Contents


The source code


The motion of an object moving near the surface of the earth can be described using the equations:

x = xo + vxot (1)
 
y = yo + vyot − 0.5gt2      (2)

The calculator solves these two simultaneous equations to obtain a description of the ballistic trajectory. The horizontal and vertical components of initial velocity are determined from:

vxo = vo cos θ
 
vyo = vo sin θ

Then the calculator computes the time to reach the maximum height by finding the time at which vertical velocity becomes zero:

vy = vyo − gt
 
 trise vyo
 g 

Maximum height is obtained by substitution of this time into equation (2).

h = yo + vyot − 0.5gt2

Next, the time to fall from the maximum height is computed by solving equation (2) for an object dropped from the maximum height with zero initial velocity.

0 = h − 0.5gt2
 
tfall
 2h 
g

The total flight time of the projectile is then:

T = trise + tfall

From this, equation (1) gives the maximum range:

R = vxotflight

The projectile speed at impact vf is determined by applying the Pythagorean Theorem:

vf  vxf2 + vyf2 

In which:

vxf = vxo
 
vyf = −gtfall