How to use it
Choose a launch angle, a launch speed and a launch height, then press Fire. The projectile flies along its path while the trace is drawn, and the readouts show the range, the maximum height, the flight time and the impact speed. Fire again with new settings and the earlier paths stay on screen in other colours, so you can compare them. Until you fire, a dashed line previews the path for the current settings.
Pick another world from the Body menu, switch on air resistance and wind, or show a target and try to hit it. The view zooms by itself so the whole path always fits, with distances marked in metres.
Controls
- Mouse and touch: use the sliders, menus and buttons. Fire starts a throw, Pause freezes it, Clear all removes every path and resets the score.
- Keyboard: Tab moves between controls and sliders respond to the arrow keys. With the view focused, Enter fires, Space pauses or resumes, the up and down arrows change the angle, the left and right arrows change the speed (hold Shift for bigger steps) and C clears everything.
- Launch: angle from −45° to 90°, speed up to 100 m/s, height up to 100 m, and gravity from a preset body or a custom value.
- Target: distance, height and radius, or a random placement. The score counts hits and throws while the target is shown.
- Display: total velocity vector, its components, the preview and whether earlier throws are kept.
How it works
Without air, the horizontal and vertical motions are independent. Horizontally the speed stays constant. Vertically the projectile has a constant downward acceleration g. With launch speed v, angle θ and launch height h:
y(t) = h + v sinθ · t − ½gt2
Eliminating t gives a parabola. Setting y = 0 gives the results the readouts show:
range R = v cosθ · T
maximum height H = h + (v sinθ)2 / (2g)
impact speed = √(v2 + 2gh)
On level ground (h = 0) the range becomes v2 sin 2θ / g, largest at 45°. For 45°, 20 m/s and g = 9.81 m/s² that is 40.77 m, a height of 10.19 m and a flight time of 2.88 s. The “Range, no air” readout always shows this formula.
With air resistance there is no simple formula, so the page integrates the motion numerically. The drag force is ½ρCdA|u|u, where ρ is the air density, Cd the drag coefficient, A the cross-section area of the ball and u its velocity relative to the air. Wind simply shifts the air’s velocity. Dividing by the mass gives the acceleration. The speed at which drag balances weight is the terminal speed, √(2mg / (ρCdA)). The solver is the fourth-order Runge–Kutta method with a fixed step of 2 ms. The landing point is found by interpolating inside the last step and refining it, and a hit is registered when the path between two steps passes within the target radius.
The model is simplified: gravity and the drag coefficient are constant, the ground is flat, the air density does not change with height, and spin and Earth’s rotation are ignored. The Body menu changes gravity only, not the air. The Moon has no atmosphere, so leave air resistance off there to match reality.
Things to try
- Fire at 30° and at 60° with the same speed. Without air they land at the same spot, because sin 2θ is equal for complementary angles.
- Raise the launch height to 20 m and search for the longest range. The best angle is now below 45°.
- Switch on air resistance and repeat. The paths become lopsided, with a steeper descent than ascent, and the best angle drops further.
- Compare Earth, the Moon and Jupiter with identical settings. The range scales inversely with gravity, so the Moon throws about six times farther than Earth.
- With air on, try a headwind and a tailwind, then a light, wide ball against a heavy, small one.
- Show the target, press Random target and try to hit it with as few throws as you can. Then add wind.
Frequently asked questions
Does the mass change the path?
Not without air. Gravity accelerates every mass equally. With air resistance, a heavier ball of the same size is slowed less and flies closer to the ideal parabola.
Why is the impact speed equal to the launch speed?
On level ground with no air, energy is conserved, so the ball returns to the launch height with the same speed. From a higher launch point it lands faster, and with air it lands slower.
Is 45° always the best angle?
Only on level ground without air. Launching from a height or adding drag lowers the best angle.
How exact are the numbers?
Without air they match the formulas to a tiny fraction of a millimetre, because the integrator is exact for constant acceleration. With air, the error of the 2 ms step is far below what the sliders can express.
Is it realistic for a real ball?
Roughly. Real drag coefficients vary with speed, and spin can curve the path. Treat the results as a clear model, not a ballistics table.