S Lazy-H
  • Home
  • About
  • Posts
  • Contact
  • Slide Rules
  • A Biker’s Tale

Ballistics

C++
mathematics
sports
Author

Sam Hutchins

Published

October 15, 2026

A few days ago, I was thinking about the mechanics of shooting a crossbow bolt up in the air just to see how long it would take to land, and how high it would travel before returning to the ground. At that point I realized I had no idea just what I would be getting into. So then, I decided to figure what the parameters would actually be for something like that. Early on, I began to suspect that the attempt may not be such a good idea.

So the idea was born to actually determine what the real values would be. First, I had to identify the formulae for the three parameters needed. The determining factor, the launch velocity of a crossbow bolt (or arrow), would determine the other parameters, such as maximum height, time of flight, distance (range) of flight. I was not interested in the trajectory, so did not determine that.

The formula for the maximum height uses the initial velocity and the gravity factor, which is 32.17404855643 feet per second, or 9.80665 meters per second.

\[Height = \frac{velocity^{2} \sin^{2}(angle)}{(2 * gravity)}\]

Next, the time of flight uses the formula that looks a lot like the standard quadratics formula, with a few changes.

\[Time = \frac{velocity^{2} \sin(angle) + \sqrt{(velocity \sin(angle))^{2} + 2 * gravity}}{gravity}\]

Finally, to determine how far the arrow/bolt would travel, depending on the launch angle and velocity, we use the following formula.

\[Range = \frac{velocity^{2} (2 \sin(angle) \cos(angle))}{gravity}\]

There are many paths that can be taken to automate those formulae, so I decided to use C++ as the vehicle. There are a few things about C++ that are better done using R, such as squaring a value, but I will use C++ anyway. The program is fairly straightforward and short. We define a few variables, the formulas necessary, then display the results. I made no attempt to account for wind resistance, which would likely require some humidity and barometric pressure values.

Code
double fps{}, heightFT{}, heightMT{}, mps{}, time{}, angle{}, rangeFT{}, rangeMT{};
double accelFPS{32.17404855643};
double accelMPS{9.8067};
double pi{3.141592653589793238462};
cout << "\nInput values are in feet per second.\n";
cout << "Air resistance neglected.\n";
cout << "Enter FPS: "; cin >> fps;
cout << "Enter angle: "; cin >> angle;
angle = angle * (pi /180);
mps = fps * 0.3048;
heightFT = (((fps)*(fps))*(sin(angle)*sin(angle))) / ( 2 * accelFPS);
heightMT = (((mps)*(mps))*(sin(angle)*sin(angle))) / ( 2 * accelMPS);
time = (fps * sin(angle) + sqrt(((fps*sin(angle))*(fps*sin(angle))) + (2*accelFPS))) / accelFPS;
rangeFT = (((fps)*(fps)) * (2 * sin(angle)*cos(angle))) / accelFPS;
rangeMT = rangeFT * 0.3048;
if(rangeFT < 1) { rangeFT = 0; rangeMT = 0;}
cout << "Maximum height: " << heightFT << " feet.\n";
cout << " @" << mps << " m/sec: " << heightMT << " meters. \n";
cout << "Maximum flight time: " << time << " sec.\n";
cout << "Range: " << rangeFT << " ft. " << rangeMT << " meters.\n";

Anyway, the final result made me realize it was probably not a good idea to shoot an arrow straight up in the air, Why? Well, after looking at the figures, I recognized that it could be very dangerous, and I could easily lose the bolt/arrow, and not be able to find it, or even know for sure where it would land.

For example, lets plug in some values to use for the results: 400 feet per second and 90 degrees straight up. These are the final values:

  • Velocity: 400 fps
  • Angle: 90 degrees
  • Height: 2486 feet
  • Time: 25 seconds
  • Range: 0

I realized if the bolt/arrow were almost a half-mile in altitude, it would be very difficult to track its trajectory, and could easily become dangerous on its descent, especially as the flight time would be almost 1/2 minute.

Another example we can use for the maximum distance traveled would require an angle of 45 degrees.

  • Velocity: 400 fps
  • Angle: 45 degrees
  • Height: 1243 feet
  • Time: 17 seconds
  • Range: 4973 feet

The flight time is shorter, but would require traipsing 9/10 mile to find and retrieve the bolt/arrow. Would you yell, “Fore!” before launching?

So, the bottom line is it’s not worth doing, as there are few positive aspects to an endeavor as described. So the better part of valor is not to attempt this, and stay safe! There may be more posts in the area of crossbows, targets and arrows in the future, stay tuned!

In any case, we thank God for having a little bit of common sense to not attempt this! Speaking of which, do you know God, and have you accepted His Son Jesus as your Lord and Savior? As we are in the End Times, it may be time to ask yourself that question. You lose nothing by accepting Him, and everything by not!

© S Lazy-H 2019 -