Question: I need help in a Math logic issue.
Let say I have an object that can be manipulate (move) by user.
After the user moved the object I would like the object to continue moving and decelerate to a stop.

Example, when a user move an object from point A to B with a total distance of 100pixel in X axis, after user release a finger, I want to let the object continue moving and decelerate to a stop from point B to point C.

So how can I calculate the new distance of point C if I set the time for it to decelerate and stop in 2sec?

Thank you!

Answer: 
d = ½at² + vit + d0

d0 is the point at which the user "let go". Calculate vi from the motion before letting go. Set a to something negative; you'll have to fiddle with this to get it to feel right. Increment t from 0 through 2. d is where the object will end up. Remember that a and vi are **vectors** pointing in opposite directions, and that d0 and d are **points**.
If the acceleration, a, is constant you can use the formula:

d = ½at²

With t = 2s you get d = 2a.

The acceleration is enough to accelerate to v in 2s,
so a = v/2.

You get:

d = v

So if v= 100 pixels per second, the object should continue 100 pixels if it stops in 2 seconds under constant deceleration.