--- layout: stdlib-reference --- # lerp ## Description Computes linear interpolation. ## Signature
T lerp<T>(
    T x,
    T y,
    T s)
    where T : __BuiltinFloatingPointType;

vector<T, N> lerp<T, N:int>(
    vector<T, N> x,
    vector<T, N> y,
    vector<T, N> s)
    where T : __BuiltinFloatingPointType;

matrix<T, N, M> lerp<T, N:int, M:int>(
    matrix<T, N, M> x,
    matrix<T, N, M> y,
    matrix<T, N, M> s)
    where T : __BuiltinFloatingPointType;

## Generic Parameters #### T: [\_\_BuiltinFloatingPointType](../interfaces/0_builtinfloatingpointtype-029hm/index.html) #### N : int #### M : int ## Parameters #### x : [T](lerp.html#typeparam-T) The starting value. #### y : [T](lerp.html#typeparam-T) The ending value. #### s : [T](lerp.html#typeparam-T) The interpolation factor. #### x : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\> The starting value. #### y : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\> The ending value. #### s : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\> The interpolation factor. #### x : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\> The starting value. #### y : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\> The ending value. #### s : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\> The interpolation factor. ## Return value Returns x+(y-x)*s.