Beispiel #1
0
 /// <summary>
 /// Computes max(first, second).
 /// </summary>
 /// <param name="first">The first argument.</param>
 /// <param name="second">The second argument.</param>
 /// <returns>The maximum of first and second value.</returns>
 public static Index2 Max(Index2 first, Index2 second)
 {
     return(new Index2(
                XMath.Max(first.X, second.X),
                XMath.Max(first.Y, second.Y)));
 }
Beispiel #2
0
 /// <summary>
 /// Clamps the given index value according to Max(Min(clamp, max), min).
 /// </summary>
 /// <param name="value">The value to clamp.</param>
 /// <param name="min">The first argument.</param>
 /// <param name="max">The second argument.</param>
 /// <returns>The clamped value in the interval [min, max].</returns>
 public static Index Clamp(Index value, Index min, Index max)
 {
     return(new Index(XMath.Clamp(value.X, min.X, max.X)));
 }
Beispiel #3
0
 /// <summary>
 /// Clamps the given index value according to Max(Min(clamp, max), min).
 /// </summary>
 /// <param name="value">The value to clamp.</param>
 /// <param name="min">The first argument.</param>
 /// <param name="max">The second argument.</param>
 /// <returns>The clamped value in the interval [min, max].</returns>
 public static Index2 Clamp(Index2 value, Index2 min, Index2 max)
 {
     return(new Index2(
                XMath.Clamp(value.X, min.X, max.X),
                XMath.Clamp(value.Y, min.Y, max.Y)));
 }
Beispiel #4
0
 /// <summary>
 /// Computes max(first, second).
 /// </summary>
 /// <param name="first">The first argument.</param>
 /// <param name="second">The second argument.</param>
 /// <returns>The maximum of first and second value.</returns>
 public static Index Max(Index first, Index second)
 {
     return(new Index(XMath.Max(first.X, second.X)));
 }