The Easing Zoo
Beyond the powers of there's a standard set of named shapes: sine, expo and circ change how sharply a motion starts or stops, back pulls away or overshoots, elastic wobbles and bounce lands like a ball. Each is still just a function with and , and you can read its character straight off its graph: the slope at each end, and whether it leaves the band between 0 and 1.
What the symbols mean
- Overshoot amount
How far the motion pulls back (or, in the ease-out, overshoots). 1.70158 makes it about 10% of the distance.
What the symbols mean
- Envelope
The shrinking size of the wobble: it halves every tenth of the duration.
Explanation
The easing zoo is the standard set of named easing curves that nearly every animation library ships, most of them from Robert Penner's easing equations, written for Flash animation in the early 2000s and released as open source. Each name has two parts: a shape (sine, expo, circ, back, elastic, bounce, plus the powers quad to quint from Timing: Why Motion Needs Easing) and a direction (In means the shape happens at the start, Out at the end, InOut at both). So easeOutBounce bounces at the end, like a ball landing. Every one of them is still a function with and that you drop into . It's a long list, but once you know what to look for you'll read each one off its graph at a glance.
Penner wrote his functions as ease(t, b, c, d): the time, the beginning value, the change and the duration. Divide by , ease it, multiply by , add : it's the same lerp. Below, everything uses from to and mostly the ease-out version, since the ease-in is always and the in-out is built from halves, as in the last lesson.
Sine: the gentlest. is the first quarter of a sine wave. It leaves at slope and flattens out. Its in-out version, , is the height of a point on a wheel turning half a turn at constant speed, seen edge on. That's why it looks so calm: its top speed is only times the average.
Expo: a snap. . The distance still to go halves every tenth of the duration, so the motion leaves at times the average speed and spends its whole second half creeping through the last ( is left at ). The formula never quite arrives ( is still left at ), so the code special-cases to return exactly ; the ease-in, , is likewise special-cased to return exactly at the start.
Circ: a quarter circle. is a quarter of the unit circle centered at : square both sides and you get . At that circle is vertical, so the slope is infinite: circ-out starts with a slam and brakes hard. Circ-in ends with a vertical slope, smashing into place.
Back: pull back, or overshoot. Ease-in back is
For small the term wins, so the motion first goes backward, like a character winding up before a jump (animators call that anticipation). The ease-out mirror overshoots the target and comes back. Where does come from? Find the dip. Setting gives , and since there,
Set that equal to and solve numerically, and you get . Penner's constant is the one that makes the pull-back (and the ease-out's overshoot) of the distance; with exactly, the dip is . A bigger means a bigger overshoot. The in-out version uses , because each half is squeezed to half height and needs a deeper curve to still overshoot by about of the whole move.
Elastic: a damped wobble.
is plus a sine wave inside a shrinking envelope . Take it apart: the sine advances radians per unit of , so its period is of the duration; the shift makes it start at , so ; and the envelope halves every , so each wobble is the size of the one before. It shoots up to about at , then rings down. It's a cartoon of a damped spring, which Springs: Bouncy, Critical and Sluggish does properly. Like expo, it's special-cased to land on exactly .
Bounce: parabolas. easeOutBounce is four pieces of parabola, each :
| piece | from | to | formula |
|---|---|---|---|
| fall | |||
| bounce 1 | |||
| bounce 2 | |||
| bounce 3 |
The numbers aren't arbitrary. Every piece has the same in front: the same gravity. And , so the fall reaches the target at exactly . Each bounce rises a quarter as high as the one before (, then , then back from the target), and since a parabola's height grows with the square of its width, a quarter of the height takes half the time. In units of the fall time the pieces last , which add up to . That's the : it makes the whole thing end at . Physically, it's a ball that comes off the floor at half the speed it hit it.
Reading the zoo by graph and velocity. The slope at the start says how a motion leaves: (sine-in, quad-in) is gentle, a big number (expo-out at , back-out at ) is a snap, and vertical (circ-out) is a slam. Dipping below is anticipation; rising above is overshoot; crossing again and again is a wobble; touching at a sharp corner is an impact, where the velocity flips sign in an instant.
Which one when. For everyday interface motion of 150 to 300 ms, use ease-out quad, cubic or expo: quick to respond, soft to land. Back-out gives a playful pop-in (a badge, a button that grows). Elastic and bounce grab attention, so save them for the one thing you want noticed and keep them short; they take longer to settle and get tiring when they repeat. Sine suits slow, ambient motion like a floating icon or a breathing glow.
const s = 1.70158;
const easeOutBack = (t: number) => 1 + (s + 1) * (t - 1) ** 3 + s * (t - 1) ** 2;
function easeOutBounce(t: number) {
const k = 7.5625, d = 2.75;
if (t < 1 / d) return k * t * t;
if (t < 2 / d) return k * (t - 1.5 / d) ** 2 + 0.75;
if (t < 2.5 / d) return k * (t - 2.25 / d) ** 2 + 0.9375;
return k * (t - 2.625 / d) ** 2 + 0.984375;
}
A common mistake. It's tempting to assume an easing's output stays between and because its input does. Back and elastic don't: back-out reaches and elastic-out about . That's harmless for a position, but an opacity of , a color channel above or an array index past the end breaks something. Clamp wherever the value has hard limits, or pick a curve that doesn't overshoot.
A common mistake. The overshoot is a fraction of the distance, so it grows with the move. Back-out overshoots px on a px slide but px on a px one, which may throw a panel off the edge of the screen. Keep overshooting eases for short moves, or lower for long ones.
There are four animations further down: back's anticipation and overshoot side by side, elastic inside its envelope, bounce as a ball, and a race between sine, expo and circ.
See it
Worked examples
Penner's ease-out back is with . Find , and find when it peaks and how high.
- 1
It's easiest to work with , how far from the end we are. Then .
Evaluate easeOutBounce at , and explain where its constants and come from.
- 1
Find which piece falls in. The breakpoints are , and . Since , it's the first bounce.
Practice
Type your answer and check it. Solve them all to complete the lesson.
Evaluate ease-out sine, , at .
Evaluate ease-in expo, , at .
Ease-in back is with . Find its minimum value for , to 4 decimal places.
A toast notification pops in over s with ease-out elastic, , where is the fraction of the s that has passed. The size of its wobble is set by the envelope . How many seconds after the start does the envelope fall to , a wobble?
A game designer writes a bounce ease with a fall and two bounces. All the pieces are parabolas sharing one coefficient , so each bounce rises a quarter as high as the drop before it and lasts half as long. The fall is , reaching the target at ; the first bounce then lasts and the second lasts , and the whole ease must end at . Find .
Which ease-out starts with an infinite slope, a vertical tangent at ?
A side panel slides px in s with ease-in-out sine, . What is its top speed, in px/s?
The hardest one here. Get it, and you've got this lesson.
Ease-out back is . A designer wants it to overshoot the target by exactly (a peak value of ) instead of the usual . Find , and the time of the peak, each to 4 decimal places. Enter , then .
Where it's used
Game engines, web animation libraries and design tools all ship this zoo under these exact names, so "easeOutBack, 250 ms" in a design spec means the same motion in every codebase. Interface designers lean on ease-out expo and cubic for menus and sheets, back for elements that pop in, and elastic or bounce for the occasional celebratory moment: a reward appearing, a "like" heart, a game's score counter. Character animators use the same shapes when they hand-tune curves: a back-in is anticipation before a jump, a bounce is a ball or a dropped prop, and an elastic is a springy antenna settling. Knowing the formulas lets you tune them (a 5% back, a two-bounce bounce) instead of settling for the defaults.