diff --git a/Engine.Core/Math.cs b/Engine.Core/Math.cs index 6c0c6fc..1412bc3 100644 --- a/Engine.Core/Math.cs +++ b/Engine.Core/Math.cs @@ -157,6 +157,16 @@ public static class Math /// The number raised to the power . public static float Pow(float x, float y) => MathF.Pow(x, y); + /// + /// Performs linear interpolation between two specified values. + /// + /// The type of the values, which must implement . + /// The starting value of the interpolation. + /// The ending value of the interpolation. + /// The interpolation factor, typically in the range [0, 1]. + /// A value that represents the linear interpolation between and . + public static T Lerp(T x, T y, T t) where T : IFloatingPoint => x + (y - x) * t; + /// /// Rounds a number to a specified number of fractional digits. ///