Aime F. answered 02/17/23
PhD in Physics (Yale), have taught Methods of Engineering Analysis
Projectile motion in this case has the formula (x, y) = (v₀t cosθ, y₀ + v₀t sinθ – gt²/2)
with only time t being unknown.
Eliminate t for x to get y = y₀ + x tanθ – (g/2v₀²cos²θ)x².
Therefore, when the character lands at y → 0, their horizontal position x will be the positive root of
0 = x² – (2v₀²sinθcosθ/g)x – 2v₀²y₀cos²θ/g
= (x – v₀²sinθcosθ/g)² – v₀⁴sin²θcos²θ/g² – 2v₀²y₀cos²θ/g
= (x – v₀²sinθcosθ/g)² – (v₀²sin²θ/g + 2y₀)v₀²cos²θ/g.
It's interesting to note from this formula that if the initial height y₀ < –v₀²sin²θ/2g there could be no solution.