Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

math.lerp

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static float lerp(float start, float end, float t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

float The interpolation from start to end.

Description

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

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


Declaration

public static float2 lerp(float2 start, float2 end, float t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

float2 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static float3 lerp(float3 start, float3 end, float t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

float3 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static float4 lerp(float4 start, float4 end, float t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

float4 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static float2 lerp(float2 start, float2 end, float2 t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

float2 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static float3 lerp(float3 start, float3 end, float3 t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

float3 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static float4 lerp(float4 start, float4 end, float4 t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

float4 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static double lerp(double start, double end, double t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

double The interpolation from x to y.

Description

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

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


Declaration

public static double2 lerp(double2 start, double2 end, double t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

double2 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static double3 lerp(double3 start, double3 end, double t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

double3 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static double4 lerp(double4 start, double4 end, double t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

double4 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static double2 lerp(double2 start, double2 end, double2 t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

double2 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static double3 lerp(double3 start, double3 end, double3 t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

double3 The componentwise interpolation from x to y.

Description

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

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


Declaration

public static double4 lerp(double4 start, double4 end, double4 t);

Parameters

Parameter Description
start The start point, corresponding to the interpolation parameter value of 0.
end The end point, corresponding to the interpolation parameter value of 1.
t The interpolation parameter. May be a value outside the interval [0, 1].

Returns

double4 The componentwise interpolation from x to y.

Description

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

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