# Problem im not able to figure out

• Apr 28th 2013, 05:18 AM
CakeSpear
Problem im not able to figure out
Hi
I have a Ball located H pixels above ground level.
The Ball uses decimal coordinates ( meaning X Y coordinates can be 1,25 or 56,9 etc ).

Every Seconds:
- Ball is displaced GravityValue number of pixels in the Ydirection
- G is added to Balls GravityValue

Im after an expression:
How many Seconds does it take for the Ball to reach ground level?
• Apr 28th 2013, 05:41 AM
HallsofIvy
Re: Problem im not able to figure out
So you have an initial downward speed of "G" and every second "G" is added to its speed? Then it should be easy to see that the speed after n seconds is nG. Further the distance traveled in n seconds will be G+ 2G+ 3G+ ...+ nG= G(1+ 2+ 3+ ...+ n). That last is an "arithmetic sum". It is well known (and typically learned in a "precalculus" class if not in algebra) that the sum is 1+ 2+ 3+ ...+ n= n(n+1)/2.

So, if I have understood your scenario correctly, the distance the object falls in n seconds is Gn(n+1)/2. To find the time required to fall a given distance, h, solve Gn(n+1)/2= h.
n(n+1)= n^2+ n= 2h/G or n^2+ n- 2h/G= 0. You can solve that using the quadratic formula. If, as appears from what you can say, that you can only deal with integer numbers of seconds, if the solution is n.****, not an integer, then all you can say is that the time to hit the surface is between n and n+1 seconds.
• May 1st 2013, 10:09 AM
CakeSpear
Re: Problem im not able to figure out
Thanks :)
However i ended up taking a different approach to my original problem