feat: Math.Sin & Math.Cos
This commit is contained in:
parent
85f0555c59
commit
12cb144688
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue