there are extra unused parameters and incorrect variable (re)declarations in some equations. The result is in fact inconsistant.
Here is a clean version (note: tabulations are set to 4 spaces, here GitHub uses 8 spaces):
// -----------------------------------------------------------
// jQuery Easing v1.3 - Copyright © 2008 George McGinley Smith
// -----------------------------------------------------------
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend(jQuery.easing, {
// unused: x = null (for jQuery compatibility)
// required: t = current time, b = beginning value, c = change in value, d = duration
// optional: s = outer sweep for ease[In/Out]Back (default = 1.70158)
def: 'easeOutQuad',
swing: (x,t,b,c,d) =>
jQuery.easing[/*alert(jQuery.easing.default),*/jQuery.easing.def](x,t,b,c,d),
linear: (x,t,b,c,d) =>
( t / d
) * c + b,
easeOutSine: (x,t,b,c,d) =>
( Math.sin(t / d * Math.PI / 2)
) * c + b,
easeInSine: (x,t,b,c,d) =>
( 1 - Math.cos(t / d * Math.PI / 2)
) * c + b,
easeInOutSine: (x,t,b,c,d) =>
( (1 - Math.cos(t / d * Math.PI)) / 2
) * c + b,
easeOutQuad: (x,t,b,c,d) =>
( (t /= d) * (2 - t)
) * c + b,
easeInQuad: (x,t,b,c,d) =>
( (t /= d) * t
) * c + b,
easeInOutQuad: (x,t,b,c,d) =>
( (t /= d / 2) < 1
? t * t / 2
: (1 - (--t) * (t - 2)) / 2
) * c + b,
easeOutCubic: (x,t,b,c,d) =>
( (t = t/d - 1) * t * t + 1
) * c + b,
easeInCubic: (x,t,b,c,d) =>
( (t /= d ) * t * t
) * c + b,
easeInOutCubic: (x,t,b,c,d) =>
( (t /= d / 2) < 1
? t * t * t / 2
: ((t -= 2) * t * t + 2) / 2
) * c + b,
easeOutQuart: (x,t,b,c,d) =>
( 1 - (t = (t = t / d - 1) * t) * t
) * c + b,
easeInQuart: (x,t,b,c,d) =>
( (t = (t /= d) * t) * t
) * c + b,
easeInOutQuart: (x,t,b,c,d) =>
( (t /= d / 2) < 1
? (t *= t) * t / 2
: 1 - (t = (t -= 2) * t) * t / 2
) * c + b,
easeOutQuint: (x,t,b,c,d) =>
( (t = t / d - 1) * (t *= t) * t + 1
) * c + b,
easeInQuint: (x,t,b,c,d) =>
( (t /= d) * (t *= t) * t
) * c + b,
easeInOutQuint: (x,t,b,c,d) =>
( (t /= d / 2) < 1
? t * (t *= t) * t / 2
: 1 + ((t -= 2) * (t *= t) * t / 2
) * c + b,
easeOutExpo: (x,t,b,c,d) =>
( (t == d ? 0
: 1 - Math.pow(2, t / d * -10))
) * c + b,
easeInExpo: (x,t,b,c,d) =>
( t == 0 ? 0
: Math.pow(2, (t / d - 1) * 10)
) * c + b,
easeInOutExpo: (x,t,b,c,d) =>
( t == 0 ? 0 : (t /= d / 2) == 1 ? 1 : t < 1
? Math.pow(2, (t - 1) * 10) / 2
: 1 - Math.pow(2, (1 - t) * 10) / 2
) * c + b,
easeOutCirc: (x,t,b,c,d) =>
( Math.sqrt(1 - (t = t / d - 1) * t)
) * c + b,
easeInCirc: (x,t,b,c,d) =>
( 1 - Math.sqrt(1 - (t /= d) * t)
) * c + b,
easeInOutCirc: (x,t,b,c,d) =>
( (t /= d / 2) < 1
? (1 - Math.sqrt(1 - t * t) ) / 2
: ( Math.sqrt(1 - (t -= 2) * t) + 1) / 2
) * c + b,
easeOutElastic: (x,t,b,c,d) =>
( (t /= d) == 1 ? 1
: 1 - Math.pow(2, t * -10) * Math.cos(t * Math.PI / 0.15)
) * c + b,
easeInElastic: (x,t,b,c,d) =>
( (t /= d) == 0 ? 0 : t == 1 ? 1
: Math.pow(2, (t -= 1) * 10) * Math.cos(t * Math.PI / 0.15)
) * c + b,
easeInOutElastic: (x,t,b,c,d) =>
( t == 0 ? 0 : (t /= d / 2) == 2 ? 2 : t < 1
? Math.pow(2, (t -= 1) * 10) * Math.cos(t * Math.PI / 0.225) / 2
: 1 - Math.pow(2, (t -= 1) * -10) * Math.cos(t * Math.PI / 0.225) / 2
) * c + b,
easeOutBounce: (x,t,b,c,d) =>
( (t /= d) < 1 / 2.75 ? (t * 7.5625) * t
: t < 2 / 2.75 ? (t -= 1.5 / 2.75 * 7.5625) * t + 0.75
: t < 2.5 / 2.75 ? (t -= 2.25 / 2.75 * 7.5625) * t + 0.9375
: (t -= 2.625 / 2.75 * 7.5625) * t + 0.984375
) * c + b,
easeInBounce: (x,t,b,c,d) =>
( 1 - jQuery.easing.easeOutBounce(x, 1 - t / d, 0, 1, 1)
) * c + b,
easeInOutBounce: (x,t,b,c,d) =>
( (t /= d / 2) < 1
? jQuery.easing.easeInBounce (x, t, 0, 1, 1) / 2
: 1 + jQuery.easing.easeOutBounce(x, t - 1, 0, 1, 1) / 2
) * c + b,
easeOutBack: (x,t,b,c,d,s) =>
( ( ((s=(s==undefined?1.70158:s) + 1) * (t = t / d - 1) + s) * t + 1) * t
) * c + b,
easeInBack: (x,t,b,c,d,s) =>
( ( (s=(s==undefined?1.70158:s) + 1) * (t /= d) - s) * t * t
) * c + b,
easeInOutBack: (x,t,b,c,d,s) =>
( (t /= d / 2) < 1
? ( (s=(s==undefined?1.70158:s) * 1.525 + 1) * t - s) * t * t / 2
: ( (s=(s==undefined?1.70158:s) * 1.525 + 1) * (t -= 2) + s) * t * t / 2 + 1
) * c + b,
});
There are too many parameters in all "easing" functions (making them not so easy to use) !
This could be avoided by passing a single normalized parameter t in 0..1, (and optional parameter s) so that all basic ease functions are also returning normalized values in 0..1 (possibly with external sweep in the middle near the two ends, if the easing is "amortized" on both ends.
As well the two parameters b and c are not so convenient: practical use prefer using start and end values directly (where b = start, c = end-start) for describing animations.
Ideally, there should be a clean way to control the maximum sweeping, not jsut for ease[In/Out]Back, but also ease[In/Out]Elastic (which should then use the "s" parameter too.
In the current implementation of ease[In/Out]Back, there's an internal variable "s" but it is incorrectly used and finally voided, producing the same value as the simplified equation above where the specific value of internal variables s and p are fixed, so that the formula reduces to a "sin(x + pi/2)" equivalent to a simpler "-cos(x)" (as written above).
I wonder if this behavior was the use of the old parameter x (always passed as null and taking needless memory and stack). This is probably an old bad design of jQuery's easings (which originally only defines the "linear" and "swing" modes, "swing" being an alias for the OutQuad method (find for implementing very "reactive" UI buttons, but not for realistic animations, especially for scenes in 2D/3D emulating normal physics, including in games)... Only the linear and quadratic curves are really realistic, quadratic to emulate objects falling down due to gravity. The elastic and bounding moves is not well suited because of arbitrarily fixed parameters. Even the existing bouncing is not realistic because it uses an infinitely hard surface and has no segment of elastic deceleration near the bounding surface (thing about how balls are bouncing on a surface: they are deformed and the surface is also deformed, both elastically, or sometimes semi-elastically (e.g. on non-compacted natural ground where this leaves a hole, and where a part of the energy is absorbed and not entirely reflected even on hard surfaces, e.g. when bouncing on a sand surface, or on water, sometimes even entering within water; another part is dissipated as temperature without "moving" any fragment of the bouncing surface, except temporarily, and another part of the energy creating "waves" around the impact and absorbing a lot of the energy but not as significant temperature elevation).
Note that .animate(...) can be chained in a queue (jQuery creates and uses a default queue for each animatable object) using .animate(...).animate(...).
jQuery provides unnecessary callbacks for start and end events, which should be just inserted in the queue as an .animate(...) with duration=0. Animations in jQuery still required more work.
As well easings should be easier to do for 2D/3D animations using Bezier splines curves: instead of just using static values (min and max for t=0 and t=1 respectively, we should be able to link two easings for each coordinate in 2D, or three easings in 3D).
As well the easings above should have a way to specificy the parameters fixing the differential speed (negative or positive) at start and end; the functions above have a single fixed value for start and end speeds with limited values: 0, 1 or infinite (this is fixed at end only for easeIn* and easeOut*, and arbitratrily fixed at both start and end on the same value for easeInOut*, splitting the range arbitrarily in two mirrored parts exactly in the middle of time range)...
Animations using quadratic, cubic or elliptic beziers cannot be designed so simply with basic bezier control points or radii or focal points for elliptic curves given in their coordinate space: we have to predecompose the Bezier to create a parametric equation based on time and measuring the length along the Bezier or ellipitic curve to compute the final coordinate. So these easings are mostly fitted only for 1D effects.
Outside jQuery, in the CSS or SVG or OpenGL working groups, there are ongoing works on what is needed to describe a 2D or 3D scene: none of these easings are usable, except the "linear" one for moves along small arcs. Animations are then just basic designs made for 1D