Skip to content
API referenceDevelopmentEngine APIEngine ccf7d03f
Synced
  • Linearly interpolates between two values.

API: engine
Project: Inno.Core.Mathematics

public static float Inno.Core.Mathematics.MathHelper.Lerp(float value1, float value2, float amount)

Parameter value1: Source value.

Parameter value2: Destination value.

Parameter amount: Value between 0 and 1 indicating the weight of value2.

Interpolated value.

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.