25#ifndef TWEENY_DETAIL_EASING_QUADRATIC_H
26#define TWEENY_DETAIL_EASING_QUADRATIC_H
28namespace tweeny::detail {
29 struct quadraticInEasing {
31 static T run(
const float position, T start, T end) {
32 return static_cast<T
>((end - start) * position * position + start);
36 T operator()(
const float position, T start, T end)
const {
37 return run<T>(position, start, end);
41 struct quadraticOutEasing {
43 static T run(
const float position, T start, T end) {
44 return static_cast<T
>((-(end - start)) * position * (position - 2) + start);
48 T operator()(
const float position, T start, T end)
const {
49 return run<T>(position, start, end);
53 struct quadraticInOutEasing {
55 static T run(
float position, T start, T end) {
58 return static_cast<T
>((end - start) / 2 * position * position + start);
62 return static_cast<T
>(-(end - start) / 2 * (position * (position - 2) - 1) + start);
66 T operator()(
const float position, T start, T end)
const {
67 return run<T>(position, start, end);