| InterpolationHelperLerp Method (Single, Single, Single) |
Performs a linear interpolation between two values (single-precision).
Namespace: DigitalRune.Mathematics.InterpolationAssembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax public static float Lerp(
float source,
float target,
float parameter
)
Public Shared Function Lerp (
source As Single,
target As Single,
parameter As Single
) As Single
public:
static float Lerp(
float source,
float target,
float parameter
)
static member Lerp :
source : float32 *
target : float32 *
parameter : float32 -> float32
Parameters
- source
- Type: SystemSingle
The source value. - target
- Type: SystemSingle
The target value. - parameter
- Type: SystemSingle
The interpolation parameter that lies in the interval [0,1]; also known as interpolation
factor or weight of the target value.
Return Value
Type:
SingleThe linear interpolation of two values.
Remarks Lerp(a, b, 0) returns a. Lerp(a, b, 1) returns b.
The interpolation parameter can lie outside of the interval [0, 1].
Outside of this interval the method actually performs an extrapolation instead of an
interpolation.
See Also