diff --git a/src/Math/Fixed/Vector2.cs b/src/Math/Fixed/Vector2.cs index be63811c..b05a733d 100644 --- a/src/Math/Fixed/Vector2.cs +++ b/src/Math/Fixed/Vector2.cs @@ -226,6 +226,21 @@ namespace MoonWorks.Math.Fixed return new Vector2((int) X, (int) Y); } + /// + /// Creates a new that contains linear interpolation of the specified vectors. + /// + /// The first vector. + /// The second vector. + /// Weighting value(between 0.0 and 1.0). + /// The result of linear interpolation of the specified vectors. + public static Vector2 Lerp(Vector2 value1, Vector2 value2, Fix64 amount) + { + return new Vector2( + Fix64.Lerp(value1.X, value2.X, amount), + Fix64.Lerp(value1.Y, value2.Y, amount) + ); + } + /// /// Returns a representation of this in the format: /// {X:[] Y:[]}