From 12cb144688ff7ead5c6f39a381b15b650c4afcc8 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Wed, 6 Nov 2024 23:00:10 +0300 Subject: [PATCH] feat: Math.Sin & Math.Cos --- Engine.Core/Math.cs | 14 ++++++++++++++ Engine.Core/MathExtensions.cs | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/Engine.Core/Math.cs b/Engine.Core/Math.cs index 07b7c24..48b11e2 100644 --- a/Engine.Core/Math.cs +++ b/Engine.Core/Math.cs @@ -38,6 +38,20 @@ public static class Math /// The absolute value of . public static T Abs(T x) where T : INumber => x > T.Zero ? x : -x; + /// + /// Returns the cosine of a number. + /// + /// The number. + /// The cosine of . + public static float Cos(float x) => MathF.Cos(x); + + /// + /// Returns the sine of a number. + /// + /// The number. + /// The sine of . + public static float Sin(float x) => MathF.Sin(x); + /// /// Returns the arccosine of a number. /// diff --git a/Engine.Core/MathExtensions.cs b/Engine.Core/MathExtensions.cs index 9fba5b8..5232fbc 100644 --- a/Engine.Core/MathExtensions.cs +++ b/Engine.Core/MathExtensions.cs @@ -8,6 +8,12 @@ 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);