interpolation/Linear/Float

Summary

Function: float fLin( float x, float y, float t );

Interpolates between two floating point values in a linear fashion.
Returns a float

• float x
• float y
• float t

Specification

float fLin(float x, float y, float t) {
    return x*(1-t) + y*t;
}
// Released into public domain. By Nexii Malthus.

Examples

float value = fLin(-5, 15, 0.6); // value == 7