Hello @EKEN ,
You can also do a search here for easing:
https://processing.org/
Example on Processing site with description:
https://processing.org/examples/easing.html
Take a look at this example:
The easing in example above is the same as yours except that it eases across the screen with a keyPressed() and expanded below:
void keyPressed()
{
targetX = width;
float dx = targetX-x;
x += dx*easing;
println(x, easing, targetX); // Very useful to print values to console
}
:)