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
- Type: Method
- Namespace: Unity.Mathematics
- Assembly: UnityEngine.MathematicsModule
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
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.
public static float2 lerp(float2 start, float2 end, float t)
Parameters
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.
public static float3 lerp(float3 start, float3 end, float t)
Parameters
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.
public static float4 lerp(float4 start, float4 end, float t)
Parameters
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.
public static float2 lerp(float2 start, float2 end, float2 t)
Parameters
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.
public static float3 lerp(float3 start, float3 end, float3 t)
Parameters
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.
public static float4 lerp(float4 start, float4 end, float4 t)
Parameters
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.
public static double lerp(double start, double end, double t)
Parameters
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.
public static double2 lerp(double2 start, double2 end, double t)
Parameters
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.
public static double3 lerp(double3 start, double3 end, double t)
Parameters
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.
public static double4 lerp(double4 start, double4 end, double t)
Parameters
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.
public static double2 lerp(double2 start, double2 end, double2 t)
Parameters
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.
public static double3 lerp(double3 start, double3 end, double3 t)
Parameters
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.
public static double4 lerp(double4 start, double4 end, double4 t)
Parameters
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.