diff --git a/Engine.Core/Math.cs b/Engine.Core/Math.cs index 14ba680..4078693 100644 --- a/Engine.Core/Math.cs +++ b/Engine.Core/Math.cs @@ -30,6 +30,16 @@ public static class Math /// public const float DegreeToRadian = Pi / 180f; + /// + public static T OneOver(T value) where T : INumber => T.One / value; + + /// + /// Gets 1 / value of given . + /// + /// The value . + /// 1 / value of given . + public static T Invert(T value) where T : INumber => T.One / value; + /// /// Gets one minus of given . /// diff --git a/Engine.Core/MathExtensions.cs b/Engine.Core/MathExtensions.cs index ac67041..6a3a31d 100644 --- a/Engine.Core/MathExtensions.cs +++ b/Engine.Core/MathExtensions.cs @@ -8,6 +8,12 @@ public static class MathExtensions /// public static T OneMinus(this T value) where T : INumber => Math.OneMinus(value); + /// + public static T OneOver(this T value) where T : INumber => Math.OneOver(value); + + /// + public static T Invert(this T value) where T : INumber => Math.OneMinus(value); + /// public static T Add(this T left, T value) where T : INumber => Math.Add(left, value);