| home | contents | send comment | send link | add bookmark |

Ballistic Trajectory (2-D) Calculator

by Stephen R. Schmitt

  Enter parameters:  
vo = meters/second
θ° = degrees
yo = meters
  Results:  
R (range) = meters
h (height) = meters
T (flight) = seconds
vf = meters/second

Apply rounding   No rounding


Contents

  1. About
  2. The source code
  3. Discussion

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 Java Script source code for this program can be viewed by using the View|Source command of your web browser.

You may use or modify this source code in any way you find useful, provided that you agree that the author has no warranty, obligations or liability. You must determine the suitablility of this source code for your use.

Return to Contents


Discussion

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

(1): x = xo + vxo·t

(2): y = yo + vyo·t - 0.5·g·t2

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 - g·t

trise = vyo/g

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

h = yo + vyo·t - 0.5·g·t2

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.5·g·t2

tfall = √(2·h/g)

The total flight time of the projectile is then:

tflight = trise + tfall 

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

range = vxo·tflight

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

vf = √(vxf2 + vyf2)

In which:

vxf =  vxo

vyf = -g·tfall

Return to Contents


AbCd Classics - free on-line books


Copyright © 2004, Stephen R. Schmitt