Unclamp linear
The linear expression in After Effects currently clamps t between tMin and tMax like so:
linear(0,1,2,100,200) = 100
While animating, it is useful to have the ability to overshoot and undershoot values, which linear does not have the ability to do with its current setup. Clamping t gives far different results to a traditional lerp function:
lerp(0,1,2,100,200) = 0
I am wondering why linear is clamped? Is this a bug or a feature? If this is intended behaviour, would it be possible to unclamp linear, or introduce a lerp function which does not clamp t?
I have attempted to recreate the behaviour of both the clamped and unclamped linear functions:
function limitedLinear(t, tMin, tMax, value1, value2) { // Default AE linear
var limitedT = Math.max(tMin, Math.min(t, tMax));
var normal = (limitedT - tMin) / (tMax - tMin);
return (value1 * (1 - normal)) + (value2 * normal);
}
function limitlessLinear(t, tMin, tMax, value1, value2) { // Lerp
var normal = (t - tMin) / (tMax - tMin);
return (value1 * (1 - normal)) + (value2 * normal);
}
It is unusual that After Effects does not have a traditional implementation of lerp, so I am wondering why this is.
