Penner Easing functions in Processing

Demonstration of the raw Robert Penner easing functions implemented in the Ani library for Processing.

Easing in Processing

I needed to use the raw Robert Penner easing functions. The functions are already implemented in the Ani Library from Benedikt Gross, but there wasn’t an example to use the functions directly without using the transition and time function. Apart from timed animations you could use the functions as well as a curve in audio-visualisations (for example the Sound library can give you back an amplitude on which you can apply these functions).

In the code below I use the object, but syntax like this also works:

In this example code I used normalized values.  Which means that we use an value between 0.0 – 1.0 as input and also get that back as output.

The functions accept 4 values:

  • t is time, in this case just 0.0 – 1.0
  • b is the start, we just use 0.0
  • c is the change, we use normalized so also 1.0
  • d is the duration, because we use normalised it’s 1.0

If you only need the functions you can also copy-paste them from the Ani-library source.