Sharpex2D.Math.Vector2.Lerp C# (CSharp) Method

Lerp() public static method

Linear interpolation between the two values.
public static Lerp ( Vector2 a, Vector2 b, float amount ) : Vector2
a Vector2 The first value.
b Vector2 The second value.
amount float The amount.
return Vector2
        public static Vector2 Lerp(Vector2 a, Vector2 b, float amount)
        {
            Vector2 result = Zero;

            result.X = MathHelper.Lerp(a.X, b.X, amount);
            result.Y = MathHelper.Lerp(a.Y, b.Y, amount);

            return result;
        }