hopefully you have sketched a picture.

let h = height of the ball above the ground

x = horizontal distance from the ball's shadow to the point on the ground directly beneath it

using proportions formed by similar triangles ...

finally, note that (using a "nice" approximation )

or

(using the more accurate )