20 #ifndef ANTKEEPER_MATH_INTERPOLATION_HPP
21 #define ANTKEEPER_MATH_INTERPOLATION_HPP
40 template <
typename T,
typename S =
float>
41 [[nodiscard]] constexpr T
lerp(
const T& x,
const T& y, S a) noexcept
43 return x + (y - x) * a;
69 template <
typename T,
typename S =
float>
70 [[nodiscard]] T
log_lerp(
const T& x,
const T& y, S a)
consteval T pow(T x, T e) noexcept
Compile-time pow for unsigned integrals.
Mathematical functions and data types.
constexpr T lerp_angle(T x, T y, T a)
Linearly interpolates between two angles, x and y.
T log_lerp(const T &x, const T &y, S a)
Logarithmically interpolates between x and y.
constexpr T lerp(const T &x, const T &y, S a) noexcept
Linearly interpolates between x and y.
constexpr T wrap_radians(T radians)
Wraps an angle to [-pi, pi].