Tweeny 4.1.0
A Tweening library for modern C++
Loading...
Searching...
No Matches

◆ exponentialInOut

detail::exponentialInOutEasing exponentialInOut {}
inlineconstexpr

Exponential easing with extreme acceleration and deceleration.

The exponentialInOut easing function combines explosive acceleration in the first half with explosive deceleration in the second half. This creates one of the most dramatic, high-energy motion curves available, with rapid changes at both ends and smooth motion through the middle.

Motion profile:

  • First half: Exponential acceleration from near-zero velocity
  • Midpoint: Maximum velocity
  • Second half: Exponential deceleration to rest
  • Creates extreme S-curve shape

This easing is appropriate for:

  • High-impact transitions: Scene changes, screen swipes
  • Dramatic animations: Hero elements, focal content
  • Fast-paced interfaces: Games, action-oriented apps
  • Attention-grabbing motion: Elements that need maximum visibility
  • Strong transitions: For elements moving significant distances or longer durations (500ms+)

ExponentialInOut creates a powerful sense of momentum and energy. The motion feels purposeful and confident. However, the extreme acceleration can be disorienting if overused or applied to large elements.

Best practices:

  • Use for animations under 1 second duration
  • Apply to elements that move short to medium distances
  • Reserve for important, infrequent transitions
  • Consider quarticInOut or quinticInOut as less extreme alternatives

Mathematically: Combines exponentialIn for t < 0.5 and exponentialOut for t >= 0.5

// Page transition with explosive motion
auto position = tweeny::from(0.0f)
.to(1920.0f)
.during(40U)
.build();
// Modal dialog with dramatic appearance
auto opacity = tweeny::from(0.0f)
.to(1.0f)
.during(30U)
.build();
tweeny_builder< true, FirstValue, RemainingValues... > to(const FirstValue &firstComponent, const RemainingValues &... remainingComponents) &
Adds a target keyframe to the tween.
Definition tweeny.h:109
tweeny_builder & via(EasingFunctionTypes... easing_functions)
Specifies per-component easing functions for the last keyframe segment.
Definition tweeny.h:198
constexpr detail::exponentialInOutEasing exponentialInOut
Exponential easing with extreme acceleration and deceleration.
Definition easing.h:899
tweeny_builder< false, FirstValue, RemainingValues... > from(FirstValue firstComponent, RemainingValues... remainingComponents)
Creates a new tween builder starting from the specified value(s).
Definition tweeny.h:347
See also
exponentialIn For only explosive acceleration
exponentialOut For only explosive deceleration
quinticInOut For slightly less extreme alternative
Visualize at https://easings.net/#easeInOutExpo