feat: Math.Sin & Math.Cos

This commit is contained in:
Syntriax 2024-11-06 23:00:10 +03:00
parent 85f0555c59
commit 12cb144688
2 changed files with 20 additions and 0 deletions

View File

@ -38,6 +38,20 @@ public static class Math
/// <returns>The absolute value of <paramref name="x"/>.</returns>
public static T Abs<T>(T x) where T : INumber<T> => x > T.Zero ? x : -x;
/// <summary>
/// Returns the cosine of a number.
/// </summary>
/// <param name="x">The number.</param>
/// <returns>The cosine of <paramref name="x"/>.</returns>
public static float Cos(float x) => MathF.Cos(x);
/// <summary>
/// Returns the sine of a number.
/// </summary>
/// <param name="x">The number.</param>
/// <returns>The sine of <paramref name="x"/>.</returns>
public static float Sin(float x) => MathF.Sin(x);
/// <summary>
/// Returns the arccosine of a number.
/// </summary>

View File

@ -8,6 +8,12 @@ public static class MathExtensions
/// <inheritdoc cref="Math.Abs{T}(T)" />
public static T Abs<T>(this T x) where T : INumber<T> => Math.Abs(x);
/// <inheritdoc cref="Math.Cos(float)" />
public static float Cos(this float x) => Math.Cos(x);
/// <inheritdoc cref="Math.Sin(float)" />
public static float Sin(this float x) => Math.Sin(x);
/// <inheritdoc cref="Math.Acos(float)" />
public static float Acos(this float x) => Math.Acos(x);