Ejemplo n.º 1
0
        /*[MethodImpl((MethodImplOptions)768)]
         * private static Vector128<T> Permute<T>(Vector128<T> value, byte control)
         *  where T : unmanaged, IFormattable, IEquatable<T>, IComparable<T>
         * {
         *  if (Avx.IsSupported)
         *  {
         *      return Avx.Permute(value, control);
         *  }
         *  else if (Sse.IsSupported)
         *  {
         *      return Sse.Shuffle(value, value, control);
         *  }
         *  else
         *  {
         *      // Redundant test so we won't prejit remainder of this method on platforms without AdvSimd.
         *      throw new PlatformNotSupportedException();
         *  }
         * }*/


        /// <summary>Linearly interpolates between the corresponding values of two matrices.</summary>
        /// <param name="matrix1">The first source matrix.</param>
        /// <param name="matrix2">The second source matrix.</param>
        /// <param name="amount">The relative weight of the second source matrix.</param>
        /// <returns>The interpolated matrix.</returns>
        public static unsafe Matrix4X2 <T> Lerp <T>(Matrix4X2 <T> matrix1, Matrix4X2 <T> matrix2, T amount)
            where T : unmanaged, IFormattable, IEquatable <T>, IComparable <T>
        {
            return(new
                   (
                       Vector2D.Lerp(matrix1.Row1, matrix2.Row1, amount),
                       Vector2D.Lerp(matrix1.Row2, matrix2.Row2, amount),
                       Vector2D.Lerp(matrix1.Row3, matrix2.Row3, amount),
                       Vector2D.Lerp(matrix1.Row4, matrix2.Row4, amount)
                   ));
        }
Ejemplo n.º 2
0
 public static Matrix4X2 <T> Negate <T>(Matrix4X2 <T> value)
     where T : unmanaged, IFormattable, IEquatable <T>, IComparable <T>
 => - value;
Ejemplo n.º 3
0
 public static Matrix4X2 <T> Multiply <T>(Matrix4X4 <T> value1, Matrix4X2 <T> value2)
     where T : unmanaged, IFormattable, IEquatable <T>, IComparable <T>
 => value1 * value2;
Ejemplo n.º 4
0
 public static Matrix4X2 <T> Add <T>(Matrix4X2 <T> value1, Matrix4X2 <T> value2)
     where T : unmanaged, IFormattable, IEquatable <T>, IComparable <T>
 {
     return(value1 + value2);
 }
Ejemplo n.º 5
0
 public static Matrix4X2 <T> Subtract <T>(Matrix4X2 <T> value1, Matrix4X2 <T> value2)
     where T : unmanaged, IFormattable, IEquatable <T>, IComparable <T>
 => value1 - value2;