Template Function librapid::lerp#
Defined in File utilityFunctions.hpp
Function Documentation#
-
template<typename T, typename Lower, typename Upper, typename std::enable_if_t<typetraits::TypeInfo<T>::type == detail::LibRapidType::Scalar && typetraits::TypeInfo<Lower>::type == detail::LibRapidType::Scalar && typetraits::TypeInfo<Upper>::type == detail::LibRapidType::Scalar && std::is_floating_point_v<T> && std::is_floating_point_v<Lower> && std::is_floating_point_v<Upper>, int> = 0, typename ST = typetraits::ScalarReturnType<T>>
ST librapid::lerp(T t, Lower lower, Upper upper)# Linearly interpolate between two values.
\( \mathrm{lerp}(t, L, U) = L+t\left( U-L \right) \)
\( \mathrm{lerp}(t, L, U) = L+t\left( U-L \right) \). The result is clamped to the specified range.
- Template Parameters
T – Type of
t
Lower – Type of
lower
Upper – Type of
upper
T – Type of
t
Lower – Type of
lower
Upper – Type of
upper
- Parameters
t – Interpolation Percentage
lower – Lower bound (L)
upper – Upper bound (U)
t – Interpolation Percentage
lower – Lower bound (L)
upper – Upper bound (U)
- Returns
- Returns