I was working with Motion plugins and noticed that many of them supported non-linear interpolation based on a few basic formulas and decided that I would like to be able to do the same in my Processing projects.
The result is this Smoothing class that supports easy interpolation based on 13 linear, quadratic, cubic and sinusoidal curves.
This is a demo showing each curve plotted on an X/Y graph. Click the applet to toggle between the curves.
Curve Slideshow
( All code in this post is free for your use under the MIT license )
To see this in action, I wrote a small demo that shows the interpolation curve affecting the motion of a moving shape. Left click to move the dot, right click to change interpolation curves.
Smooth Movement
Finally, I made a demo that animates the rotation of a line in a circle. This could be suitable for a stylized sonar sweep in a game.
Funky Clock
I have implemented this class in a project of mine to control camera panning and zooming and I'm quite happy with the results.
Edit: I changed the inline applets to links, because something was causing them to load improperly in webkit based browsers like safari and chrome.
—