HOW DO WE USE IT?

The classic method

There are many uses for Lerp. The one which we will be focusing on in this article is;

Each frame, interpolate a vector position from point a to point b by a fraction of delta time.

Specifically we’re looking at the following case:

lerp(currentPosition, targetPosition, deltaTime * strength)

By moving some fraction of the remaining distance between where we are currently, and where we would like to be, we move in progressively smaller steps towards our target, giving the appearance of smooth motion.

As we can see above, the movement eases in. Over the course of the movement, the velocity is largest on the first frame and smallest on last frame. This is because the distance between a and b is largest on the first frame, and lerp moves a fraction of the distance between a and b per frame.

We don’t have any concept of persistent velocity here, so the moment the target moves we get a sharp change in velocity followed by a smooth ease in.