Easing function macros
$ clib install glisy/ease --save
#include <glisy/ease.h>
...
float time = glfwGetTime();
vec3 from = {0, 0, 0};
vec3 to = {3, 3, 3};
float from.x = ease_in_cubic(time, from.x, 1, to.x);
float from.y = ease_in_cubic(time, from.y, 1, to.y);
float from.z = ease_in_cubic(time, from.z, 1, to.z);
simple linear tweening - no easing, no acceleration
quadratic easing in - accelerating from zero velocity
quadratic easing out - decelerating to zero velocity
quadratic easing in/out - acceleration until halfway, then deceleration
cubic easing in - accelerating from zero velocity
cubic easing out - decelerating to zero velocity
cubic easing in/out - acceleration until halfway, then deceleration
quartic easing in - accelerating from zero velocity
quartic easing out - decelerating to zero velocity
quartic easing in/out - acceleration until halfway, then deceleration
quintic easing in - accelerating from zero velocity
quintic easing out - decelerating to zero velocity
quintic easing in/out - acceleration until halfway, then deceleration
sinusoidal easing in - accelerating from zero velocity
sinusoidal easing out - decelerating to zero velocity
sinusoidal easing in/out - accelerating until halfway, then decelerating
exponential easing in - accelerating from zero velocity
exponential easing out - decelerating to zero velocity
exponential easing in/out - accelerating until halfway, then decelerating
circular easing in - accelerating from zero velocity
circular easing out - decelerating to zero velocity
circular easing in/out - acceleration until halfway, then deceleration
MIT