Last Updated : 29 Jan, 2021

In animation and games, it can be seen that many objects are moving from one point to another linearly. But after using the easing function, the object’s way of progressing can take a different natural and interesting shape.

The Easing function is the rate of change of a parameter over time. It is the kind of equation that moves slowly at the start and speed up, and slow down at the end. These set of equations are taken from Robert Penner’s book and webpage.

Syntax:

`easeOutQuad(t, b, c, d)`

Parameters: This method accepts four parameter as mentioned above and described below.

• t: This parameter holds the specified time of starting of the animation. For example, if value of t is 0, it means animation is just started.
• b: This parameter holds the specified starting position of the object on x-axis. For example, if value of b is 10, it means the starting position of the objects on x-coordinate is 10.
• c: This parameter holds the specified change in value for the object. For example, if value of c is 30, it means, the object has to move 30 to the right, ending at 40.
• d: This parameter holds the specified duration of the whole process. For example, if the value of d is 2, it means, the object has 2 second to perform this motion from 10 to 40.

Return Value: This method returns the eased position of the object, that is the position of the object at a particular time.

Example 1:

## Javascript

 ` ` ` ` ` `  ` ` `  `` ` `  `` ` ` ` ` `  ` ` ` ` ` `  ` ` ` `  ``

Output:

```3.3125
4.326530612244898
6.625```

Example 2:

## Javascript

 ` ` ` ` ` `  ` ` `  `` ` `  `` ` ` ` ` `  ` ` ` ` ` `  ` ` ` `  ``

Output:

```36.388888888888886
26.48760330578512```

Previous
Next