# Why is speed not dependent on distance? (conservation of energy concepts involved)

as I'm beginning to learn the basics of physics, there are some concepts that confuse me.

If I'm finding the minimum speed needed for a ball to roll up a hill, the equation is: (1/2)mv^2=mgh solving for v (there is kinetic energy first, and by the time it gets up the hill there should only be potential energy as it rolls at the minimum speed, just enough to get on top of the hill) As I solve for v, the equation is rearranged to v=√2gh

What is confusing to me is that only height and the g are important for solving the question of minimum speed. (based on equation) Why doesn't distance away from the hill matter? For example if a ball was 200m away from a 4 m hill vs a ball 1 m away from a 4 m hill, the equation to find minimum speed needed to get to the top of the hill is still v= √2gh Isn't there the possibility of it slowing down before it can even get to the hill in the first scenario? Why is distance seemingly negligible?