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

◆ quadraticIn

detail::quadraticInEasing quadraticIn {}
inlineconstexpr

Quadratic polynomial easing (t²) with gentle acceleration.

The quadraticIn easing function uses a squared power curve for acceleration, providing the gentlest polynomial easing. It's more subtle than cubic but still provides noticeable easing.

Characteristics:

  • Gentle, smooth acceleration
  • Polynomial with power of 2
  • Subtle but perceptible easing
  • Good for beginners and subtle animations

This easing is ideal for:

  • Subtle UI motion: When easing should be felt but not seen
  • Quick animations: Short durations where gentle curves work best
  • Minimal designs: Interfaces prioritizing restraint
  • Learning easings: Easy to understand and predict

Mathematically: f(t) = t²

// Gentle fade in
auto opacity = tweeny::from(0.0f)
.to(1.0f)
.during(20U)
.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::quadraticInEasing quadraticIn
Quadratic polynomial easing (t²) with gentle acceleration.
Definition easing.h:993
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
quadraticOut For gentle deceleration
quadraticInOut For gentle motion at both ends
cubicIn For more pronounced acceleration
Visualize at https://easings.net/#easeInQuad