using System; using System.Numerics; namespace Syntriax.Engine.Core; public static class MathExtensions { /// public static T Abs(this T x) where T : INumber => Math.Abs(x); /// public static float Cos(this float x) => Math.Cos(x); /// public static float Sin(this float x) => Math.Sin(x); /// public static float Acos(this float x) => Math.Acos(x); /// public static float Asin(this float x) => Math.Asin(x); /// public static float Atan2(this float y, float x) => Math.Atan2(y, x); /// public static float Atanh(this float x) => Math.Atanh(x); /// public static T Clamp(this T x, T min, T max) where T : INumber => Math.Clamp(x, min, max); /// public static float Ceiling(this float x) => Math.Ceiling(x); /// public static float CopySign(this float x, float y) => Math.CopySign(x, y); /// public static float Floor(this float x) => Math.Floor(x); /// public static float IEEERemainder(this float x, float y) => Math.IEEERemainder(x, y); /// public static float Log(this float x, float y) => Math.Log(x, y); /// public static T Max(this T x, T y) where T : INumber => Math.Max(x, y); /// public static T AbsMax(this T x, T y) where T : INumber => Math.AbsMax(x, y); /// public static T Min(this T x, T y) where T : INumber => Math.Min(x, y); /// public static T AbsMin(this T x, T y) where T : INumber => Math.AbsMin(x, y); /// public static float Pow(this float x, float y) => Math.Pow(x, y); /// public static T Lerp(this T x, T y, T t) where T : IFloatingPoint => Math.Lerp(x, y, t); /// public static float Round(this float x, int digits, MidpointRounding mode) => Math.Round(x, digits, mode); /// public static T Sqr(this T x) where T : INumber => Math.Sqr(x); /// public static float Sqrt(this float x) => Math.Sqrt(x); /// public static float Truncate(this float x) => Math.Truncate(x); }