I have a ball which I kick with some force. It has a starting x,y position, sat (2,3) and an intended target x,y say (7,8) position. That means I have to translate by (7-2, 8-3) i.e. 5 x units and 5 y units to reach destination.

The things acting on this ball are

force of kick(in direction of target), gravitational pull towards floor due to mass, and friction force provided by grass.

I will experiment different values of the 3 and see which one best simulates. But how do I calculate time required to destination and how much to translate in every frame of my game?

Can anybody please give me an equation for displacement due to these 3 factors and how velocity and other factors required in the equation change with time elapsed?

  • 2
    \$\begingroup\$ hyperphysics.phy-astr.gsu.edu/hbase/hph.html#mechcon This is a general physics question. If you write out the kinematic equations (set of few linear/quadratic equations) for this you should be able to easily transfer them into code. \$\endgroup\$
    – mobo
    Aug 1, 2013 at 5:37
  • \$\begingroup\$ I would also look at linear algebra. If you want to make/use a physic engine you need to use it. blog.wolfire.com/2009/07/… \$\endgroup\$
    – mobo
    Aug 1, 2013 at 6:26
  • \$\begingroup\$ You could include air resistance / aerodynamics for the most real result. \$\endgroup\$
    – Thomas
    Aug 1, 2013 at 15:20
  • \$\begingroup\$ how to do that? \$\endgroup\$
    – epsilon8
    Aug 1, 2013 at 16:21

1 Answer 1


The ball has a kinetic energy of: enter image description here when kicked.

The force pushing the ball down to the ground can be ignored, since a ball is round, it rolls (doesn't slide), so there's no static friction.

The force of the grass cannot be ignored. And, in this case, essentially acts like static friction, like a block sliding on the ground would encounter friction from the floor, a ball rolling on the grass encounters friction from the grass. We want to know how far the ball will go. Which means we want to know when the kinetic energy of the ball is zero. We want the amount of work done to negate the kinetic energy of the ball we found in the first equation (so we set our equation equal to the negated amount and solve). The amount of work done by friction to stop the ball can be found with:

enter image description here

Solving for distance gives us:

enter image description here

Now that you have the distance, the time can be found with this answer.

However, there are a few options for simulating the movement of the ball in game. One of them could easily lead to you not getting the distance defined by the formula above.

If you're simulating the physics with an iterative approach, your final result will be different (unless your time step is crazy small, you'll have large enough errors to notice). This is similar to the differences you'd get in a Riemann sum estimation vs integration.

An iterative approach is very common in games. But if you're looking for accuracy, you can use the physics equations above and calculate the position of the ball based on the time since the simulation started. The equations for calculating the position since the start of the simulation can be the equations for constant linear acceleration. Since the forces acting on the ball are constant throughout (friction of the grass).


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .