lerp function c++

#include <iostream>

template <typename T>
T lerp(const T& a, const T& b, float t) {
    return a + (b - a) * t;
}

int main() {
    float start = 1.0f;
    float end = 5.0f;
    float interpolationFactor = 0.3f;

    float result = lerp(start, end, interpolationFactor);

    std::cout << "Linear interpolation result: " << result << std::endl;

    return 0;
}