Synced
MathHelper.Lerp
Section titled “MathHelper.Lerp”
- Linearly interpolates between two values.
Required contracts
Section titled “Required contracts”API: engine
Project: Inno.Core.Mathematics
Declaration
Section titled “Declaration”public static float Inno.Core.Mathematics.MathHelper.Lerp(float value1, float value2, float amount)Parameters
Section titled “Parameters”Parameter value1: Source value.
Parameter value2: Destination value.
Parameter amount: Value between 0 and 1 indicating the weight of value2.
Returns
Section titled “Returns”Interpolated value.
Remarks
Section titled “Remarks”This method performs the linear interpolation based on the following formula: value1 + (value2 - value1) * amount Passing amount a value of 0 will cause value1 to be returned, a value of 1 will cause value2 to be returned. See M:MathHelper.LerpPrecise(System.Single,System.Single,System.Single) for a less efficient version with more precision around edge cases.