Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


lerp

Returns the result of linearly interpolating from start to end using the interpolation parameter t.
Read time 7 minutesLast updated 10 days ago

Definition

lerp(float, float, float)

Returns the result of linearly interpolating from start to end using the interpolation parameter t.
public static float lerp(float start, float end, float t)

Parameters

start

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

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

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

Returns

Type

Description

floatThe 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.
public static float2 lerp(float2 start, float2 end, float t)

Parameters

start

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

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

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

Returns

Type

Description

float2The 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.
public static float3 lerp(float3 start, float3 end, float t)

Parameters

start

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

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

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

Returns

Type

Description

float3The 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.
public static float4 lerp(float4 start, float4 end, float t)

Parameters

start

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

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

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

Returns

Type

Description

float4The 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.
public static float2 lerp(float2 start, float2 end, float2 t)

Parameters

start

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

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

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

Returns

Type

Description

float2The 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.
public static float3 lerp(float3 start, float3 end, float3 t)

Parameters

start

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

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

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

Returns

Type

Description

float3The 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.
public static float4 lerp(float4 start, float4 end, float4 t)

Parameters

start

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

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

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

Returns

Type

Description

float4The 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.
public static double lerp(double start, double end, double t)

Parameters

start

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

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

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

Returns

Type

Description

doubleThe 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.
public static double2 lerp(double2 start, double2 end, double t)

Parameters

start

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

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

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

Returns

Type

Description

double2The 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.
public static double3 lerp(double3 start, double3 end, double t)

Parameters

start

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

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

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

Returns

Type

Description

double3The 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.
public static double4 lerp(double4 start, double4 end, double t)

Parameters

start

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

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

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

Returns

Type

Description

double4The 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.
public static double2 lerp(double2 start, double2 end, double2 t)

Parameters

start

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

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

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

Returns

Type

Description

double2The 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.
public static double3 lerp(double3 start, double3 end, double3 t)

Parameters

start

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

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

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

Returns

Type

Description

double3The 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.
public static double4 lerp(double4 start, double4 end, double4 t)

Parameters

start

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

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

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

Returns

Type

Description

double4The componentwise interpolation from x to y.

Remarks

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