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

◆ sinusoidalInOut

detail::sinusoidalInOutEasing sinusoidalInOut {}
inlineconstexpr

Sinusoidal easing with smooth acceleration and deceleration.

The sinusoidalInOut easing function uses sine curves for both acceleration and deceleration, creating the smoothest possible S-curve motion.

Motion profile:

  • First half: Smooth sine-based acceleration
  • Midpoint: Maximum velocity
  • Second half: Smooth sine-based deceleration
  • Creates extremely smooth S-curve

This easing is appropriate for:

  • Natural, organic motion: Smoothest easing available
  • Continuous loops: Seamless repeated animations
  • Calm interfaces: Relaxed, gentle design systems
  • Accessible animations: Minimal motion stress

SinusoidalInOut is the smoothest InOut easing, making it perfect when fluid, natural motion is the priority.

Mathematically: f(t) = (1 - cos(t * π)) / 2

// Ultra-smooth transition
auto x = tweeny::from(0.0f)
.to(100.0f)
.during(40U)
.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::sinusoidalInOutEasing sinusoidalInOut
Sinusoidal easing with smooth acceleration and deceleration.
Definition easing.h:1413
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
sinusoidalIn For only smooth acceleration
sinusoidalOut For only smooth deceleration
quadraticInOut For similar gentleness
Visualize at https://easings.net/#easeInOutSine