docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method lerp

    lerp(float, float, float)

    Returns the result of linearly interpolating from start to end using the interpolation parameter t.

    Declaration
    public static float lerp(float start, float end, float t)
    Parameters
    Type Name Description
    float start

    The start point, corresponding to the interpolation parameter value of 0.

    float end

    The end point, corresponding to the interpolation parameter value of 1.

    float t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    float

    The interpolation from start to end.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(float2, float2, float)

    Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t.

    Declaration
    public static float2 lerp(float2 start, float2 end, float t)
    Parameters
    Type Name Description
    float2 start

    The start point, corresponding to the interpolation parameter value of 0.

    float2 end

    The end point, corresponding to the interpolation parameter value of 1.

    float t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    float2

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(float3, float3, float)

    Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t.

    Declaration
    public static float3 lerp(float3 start, float3 end, float t)
    Parameters
    Type Name Description
    float3 start

    The start point, corresponding to the interpolation parameter value of 0.

    float3 end

    The end point, corresponding to the interpolation parameter value of 1.

    float t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    float3

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(float4, float4, float)

    Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t.

    Declaration
    public static float4 lerp(float4 start, float4 end, float t)
    Parameters
    Type Name Description
    float4 start

    The start point, corresponding to the interpolation parameter value of 0.

    float4 end

    The end point, corresponding to the interpolation parameter value of 1.

    float t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    float4

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(float2, float2, float2)

    Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t.

    Declaration
    public static float2 lerp(float2 start, float2 end, float2 t)
    Parameters
    Type Name Description
    float2 start

    The start point, corresponding to the interpolation parameter value of 0.

    float2 end

    The end point, corresponding to the interpolation parameter value of 1.

    float2 t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    float2

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(float3, float3, float3)

    Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t.

    Declaration
    public static float3 lerp(float3 start, float3 end, float3 t)
    Parameters
    Type Name Description
    float3 start

    The start point, corresponding to the interpolation parameter value of 0.

    float3 end

    The end point, corresponding to the interpolation parameter value of 1.

    float3 t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    float3

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(float4, float4, float4)

    Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t.

    Declaration
    public static float4 lerp(float4 start, float4 end, float4 t)
    Parameters
    Type Name Description
    float4 start

    The start point, corresponding to the interpolation parameter value of 0.

    float4 end

    The end point, corresponding to the interpolation parameter value of 1.

    float4 t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    float4

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(double, double, double)

    Returns the result of linearly interpolating from x to y using the interpolation parameter t.

    Declaration
    public static double lerp(double start, double end, double t)
    Parameters
    Type Name Description
    double start

    The start point, corresponding to the interpolation parameter value of 0.

    double end

    The end point, corresponding to the interpolation parameter value of 1.

    double t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    double

    The interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(double2, double2, double)

    Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t.

    Declaration
    public static double2 lerp(double2 start, double2 end, double t)
    Parameters
    Type Name Description
    double2 start

    The start point, corresponding to the interpolation parameter value of 0.

    double2 end

    The end point, corresponding to the interpolation parameter value of 1.

    double t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    double2

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(double3, double3, double)

    Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t.

    Declaration
    public static double3 lerp(double3 start, double3 end, double t)
    Parameters
    Type Name Description
    double3 start

    The start point, corresponding to the interpolation parameter value of 0.

    double3 end

    The end point, corresponding to the interpolation parameter value of 1.

    double t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    double3

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(double4, double4, double)

    Returns the result of a componentwise linear interpolating from x to y using the interpolation parameter t.

    Declaration
    public static double4 lerp(double4 start, double4 end, double t)
    Parameters
    Type Name Description
    double4 start

    The start point, corresponding to the interpolation parameter value of 0.

    double4 end

    The end point, corresponding to the interpolation parameter value of 1.

    double t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    double4

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(double2, double2, double2)

    Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t.

    Declaration
    public static double2 lerp(double2 start, double2 end, double2 t)
    Parameters
    Type Name Description
    double2 start

    The start point, corresponding to the interpolation parameter value of 0.

    double2 end

    The end point, corresponding to the interpolation parameter value of 1.

    double2 t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    double2

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(double3, double3, double3)

    Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t.

    Declaration
    public static double3 lerp(double3 start, double3 end, double3 t)
    Parameters
    Type Name Description
    double3 start

    The start point, corresponding to the interpolation parameter value of 0.

    double3 end

    The end point, corresponding to the interpolation parameter value of 1.

    double3 t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    double3

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    lerp(double4, double4, double4)

    Returns the result of a componentwise linear interpolating from x to y using the corresponding components of the interpolation parameter t.

    Declaration
    public static double4 lerp(double4 start, double4 end, double4 t)
    Parameters
    Type Name Description
    double4 start

    The start point, corresponding to the interpolation parameter value of 0.

    double4 end

    The end point, corresponding to the interpolation parameter value of 1.

    double4 t

    The interpolation parameter. May be a value outside the interval [0, 1].

    Returns
    Type Description
    double4

    The componentwise interpolation from x to y.

    Remarks

    If the interpolation parameter is not in the range [0, 1], then this function extrapolates.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)