25#ifndef TWEENY_DETAIL_EASING_SINUSOIDAL_H
26#define TWEENY_DETAIL_EASING_SINUSOIDAL_H
31#define M_PI 3.14159265358979323846
34namespace tweeny::detail {
35 struct sinusoidalInEasing {
37 static T run(
const float position, T start, T end) {
38 return static_cast<T
>(-(end - start) * cosf(position *
static_cast<float>(M_PI) / 2) + (end - start) + start);
42 T operator()(
const float position, T start, T end)
const {
43 return run<T>(position, start, end);
47 struct sinusoidalOutEasing {
49 static T run(
const float position, T start, T end) {
50 return static_cast<T
>((end - start) * sinf(position *
static_cast<float>(M_PI) / 2) + start);
54 T operator()(
const float position, T start, T end)
const {
55 return run<T>(position, start, end);
59 struct sinusoidalInOutEasing {
61 static T run(
const float position, T start, T end) {
62 return static_cast<T
>(-(end - start) / 2 * (cosf(position *
static_cast<float>(M_PI)) - 1) + start);
66 T operator()(
const float position, T start, T end)
const {
67 return run<T>(position, start, end);