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

◆ exponentialIn

detail::exponentialInEasing exponentialIn {}
inlineconstexpr

Exponential easing with very slow start and explosive acceleration.

The exponentialIn easing function starts extremely slowly and builds to a very rapid acceleration toward the end. Based on exponential growth (2^x), this creates one of the most dramatic acceleration curves available, with velocity increasing exponentially over time.

Characteristics:

  • Almost no visible motion for the first portion of the animation
  • Sudden, explosive acceleration in the final phase
  • Change rate doubles repeatedly as time progresses
  • Creates extreme contrast between start and end velocity

This easing is ideal for:

  • Dramatic reveals: Elements that burst into view
  • Explosive effects: Particle systems, energy blasts, explosions
  • Fade-ins with impact: Starting invisible and suddenly appearing
  • Speed-up effects: Rockets launching, vehicles accelerating
  • Tension building: Slow build-up to sudden release

The extreme acceleration curve makes this feel more dramatic than polynomial easings (quadratic, cubic, etc.). The motion appears to "explode" into existence rather than gradually accelerate.

Use exponentialIn when you want maximum contrast between the patient start and the explosive finish. For most UI work, cubic or quartic easings provide sufficient acceleration with less extreme behavior.

Mathematically: f(t) = 2^(10 * (t - 1))

// Fade in that suddenly snaps to full visibility
auto opacity = tweeny::from(0.0f)
.to(1.0f)
.during(45U)
.build();
// Rocket launch with explosive acceleration
auto velocity = tweeny::from(0.0f)
.to(1000.0f)
.during(120U)
.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::exponentialInEasing exponentialIn
Exponential easing with very slow start and explosive acceleration.
Definition easing.h:791
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
exponentialOut For explosive deceleration at the end
exponentialInOut For dramatic acceleration and deceleration
quarticIn For strong but less extreme acceleration
Visualize at https://easings.net/#easeInExpo