feat: added Math.OneMinus method
This commit is contained in:
parent
4bfe98852c
commit
1366a417f1
@ -30,6 +30,13 @@ public static class Math
|
||||
/// </summary>
|
||||
public const float DegreeToRadian = PI / 180f;
|
||||
|
||||
/// <summary>
|
||||
/// Gets one minus of given <see cref="T"/>.
|
||||
/// </summary>
|
||||
/// <param name="value">The value <see cref="T"/>.</param>
|
||||
/// <returns>One minus of given <see cref="T"/>.</returns>
|
||||
public static T OneMinus<T>(T value) where T : INumber<T> => T.One - value;
|
||||
|
||||
/// <summary>
|
||||
/// Adds two <see cref="T"/>s.
|
||||
/// </summary>
|
||||
|
@ -5,6 +5,9 @@ namespace Syntriax.Engine.Core;
|
||||
|
||||
public static class MathExtensions
|
||||
{
|
||||
/// <inheritdoc cref="Math.OneMinus{T}(T)" />
|
||||
public static T OneMinus<T>(this T value) where T : INumber<T> => Math.OneMinus(value);
|
||||
|
||||
/// <inheritdoc cref="Math.Add{T}(T, T)" />
|
||||
public static T Add<T>(this T left, T value) where T : INumber<T> => Math.Add(left, value);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user