Find the angle that maximises throw-in distance. Release height and air drag both push the optimum below 45°.
The science
The question. For a given release speed and height, which throw angle gives the longest throw-in? The simulator integrates the flight with RK4 (2–4 ms steps), m dv/dt = m g − ½ρA Cd|v|v (no spin), finds where the ball reaches the ground, and maximises the range over the launch angle with a golden-section search. The graph plots the full range-versus-angle curve.
Closed form (no air). From height h with speed v the range is R(θ) = (v cosθ/g)(v sinθ + √(v²sin²θ + 2gh)), maximised at tanθ* = v / √(v² + 2gh). For h = 0 this is exactly 45°; for any release height h > 0 the best angle is below 45°. Air drag lowers it further, because a flatter ball spends less time fighting drag on a steep climb.
Numerical check. The in-page check compares the closed-form vacuum optimum with the RK4 + golden-section result (they agree to a few thousandths of a degree). test_numeric.js asserts that with no drag and h = 0 the optimum is 45° and that the range at 45° equals v²/g; it also checks the closed form for several release heights and the Moon-gravity case (45° again, since g cancels in the angle).
Honest simplifications. The release speed is held constant while the angle changes; a real thrower can generate less speed for steeper, more overhead throws, which pushes the practical optimum lower (that trade-off is not modelled). Constant Cd = 0.25 and ρ = 1.2 kg/m³ are typical values; no spin, no wind, flat ground, the ball is judged at the first ground contact. The thrower is a generic figure.