Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a game I have a specific object and two positions the object will move from and to. I already have the function for calculating current position in specific time.

It works like this:

Inputting 0 will move the object to Position 1.

Inputting 1 will move the object to Position 2.

Inputting 0.5 will move the object in the middle of the two positions.


(In the examples below, time is varying from 0 to 1) When I want to start the object slowly and stop it when it is moving fast, I use:

MoveObject(sin(time * 90))

When I want to start the object fast and stop it as it is getting slower, I use:

MoveObject(1 - cos(time * 90))

Without the effects, it's:


How do I make the object start moving slowly, move fast in the center of two positions and then get slower while reaching the second position?

share|improve this question
what about MoveObject(sin(time * 180))? – Ali.S Mar 30 '13 at 19:08
This type of method would vary from 0 to 1 then again to 0 – Laimonas Mileška Mar 30 '13 at 19:10
Here's an interesting read about easing equations: – Alayric Mar 30 '13 at 19:18
That's pretty much the answer. Thanks! – Laimonas Mileška Mar 30 '13 at 19:22
so there is tanh function, but it needs some preparations before using... maybe MoveObject((tanh(time * 180 - 90) + 1) / 2) – Ali.S Mar 30 '13 at 20:13

You are looking for easing functions...

Here you have some desription:

I wrote a reply about them here with my own implemntation in C#

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.