Go to the documentation of this file. 1 #ifndef EAGINE_MATH_INTERPOLATE_HPP
9 #define EAGINE_MATH_INTERPOLATE_HPP
16 EAGINE_DIAG_OFF(
double-promotion)
24 template <
typename T,
typename C>
26 return T((1 - coef) * a + coef * b);
32 template <
typename T,
typename C>
33 static inline auto lerp(
const T& a,
const T& b, C coef) {
41 template <
typename T,
typename C>
42 static inline auto smooth_lerp(
const T& a,
const T& b, C coef) {
49 template <
typename T,
typename C>
60 #endif // EAGINE_MATH_INTERPOLATE_HPP
static auto smooth_lerp(const T &a, const T &b, C coef)
Linear interpolation with coef transformed by sine_sigmoid01.
Definition: interpolate.hpp:42
static auto sine_sigmoid01(T x)
Calculates goniometric sigmoid (cos in interval (0, 1)) of x.
Definition: functions.hpp:150
Math-related code is placed in this namespace.
Definition: eagine.hpp:48
static auto lerp(const T &a, const T &b, C coef)
Same as interpolate_linear.
Definition: interpolate.hpp:33
static auto interpolate_linear(const T &a, const T &b, C coef)
Linear interpolation between a and b.
Definition: interpolate.hpp:25
static auto smooth_oscillate(const T &a, C coef)
Smooth interpolation between negative a and a.
Definition: interpolate.hpp:50