Exemple #1
0
 /// <summary>
 /// Constrains each element to a given range.
 /// </summary>
 /// <param name="value">A matrix to constrain.</param>
 /// <param name="min">The minimum values for each element.</param>
 /// <param name="max">The maximum values for each element.</param>
 /// <returns>A matrix with each element constrained to the given range.</returns>
 public static Matrix2x3d Clamp(Matrix2x3d value, Matrix2x3d min, Matrix2x3d max)
 {
     return(new Matrix2x3d(Functions.Clamp(value.M11, min.M11, max.M11), Functions.Clamp(value.M21, min.M21, max.M21), Functions.Clamp(value.M12, min.M12, max.M12), Functions.Clamp(value.M22, min.M22, max.M22), Functions.Clamp(value.M13, min.M13, max.M13), Functions.Clamp(value.M23, min.M23, max.M23)));
 }
Exemple #2
0
 /// <summary>
 /// Returns the absolute value (per element).
 /// </summary>
 /// <param name="value">A matrix.</param>
 /// <returns>The absolute value (per element) of value.</returns>
 public static Matrix2x3d Abs(Matrix2x3d value)
 {
     return(new Matrix2x3d(Functions.Abs(value.M11), Functions.Abs(value.M21), Functions.Abs(value.M12), Functions.Abs(value.M22), Functions.Abs(value.M13), Functions.Abs(value.M23)));
 }
Exemple #3
0
 /// <summary>
 /// Returns a matrix that contains the highest value from each pair of elements.
 /// </summary>
 /// <param name="value1">The first matrix.</param>
 /// <param name="value2">The second matrix.</param>
 /// <returns>The highest of each element in left and the matching element in right.</returns>
 public static Matrix2x3d Max(Matrix2x3d value1, Matrix2x3d value2)
 {
     return(new Matrix2x3d(Functions.Max(value1.M11, value2.M11), Functions.Max(value1.M21, value2.M21), Functions.Max(value1.M12, value2.M12), Functions.Max(value1.M22, value2.M22), Functions.Max(value1.M13, value2.M13), Functions.Max(value1.M23, value2.M23)));
 }
Exemple #4
0
 /// <summary>
 /// Maps the elements of a matrix and returns the result.
 /// </summary>
 /// <param name="value">The matrix to map.</param>
 /// <param name="mapping">A mapping function to apply to each element.</param>
 /// <returns>The result of mapping each element of value.</returns>
 public static Matrix2x3f Map(Matrix2x3d value, Func <double, float> mapping)
 {
     return(new Matrix2x3f(mapping(value.M11), mapping(value.M21), mapping(value.M12), mapping(value.M22), mapping(value.M13), mapping(value.M23)));
 }
Exemple #5
0
 /// <summary>
 /// Multiplys the elements of two matrices and returns the result.
 /// </summary>
 /// <param name="left">The first matrix to modulate.</param>
 /// <param name="right">The second matrix to modulate.</param>
 /// <returns>The result of multiplying each element of left by the matching element in right.</returns>
 public static Matrix2x3d Modulate(Matrix2x3d left, Matrix2x3d right)
 {
     return(new Matrix2x3d(left.M11 * right.M11, left.M21 * right.M21, left.M12 * right.M12, left.M22 * right.M22, left.M13 * right.M13, left.M23 * right.M23));
 }
Exemple #6
0
 /// <summary>
 /// Determines whether any element of a matrix is non-zero.
 /// </summary>
 /// <param name="value">A vector.</param>
 /// <returns>true if any elements are non-zero; false otherwise.</returns>
 public static bool Any(Matrix2x3d value)
 {
     return(value.M11 != 0 || value.M21 != 0 || value.M12 != 0 || value.M22 != 0 || value.M13 != 0 || value.M23 != 0);
 }
Exemple #7
0
 /// <summary>
 /// Determines whether any elements of a matrix satisfy a condition.
 /// </summary>
 /// <param name="value">A vector.</param>
 /// <param name="predicate">A function to test each element for a condition.</param>
 /// <returns>true if any element of the matrix passes the test in the specified
 /// predicate; otherwise, false.</returns>
 public static bool Any(Matrix2x3d value, Predicate <double> predicate)
 {
     return(predicate(value.M11) || predicate(value.M21) || predicate(value.M12) || predicate(value.M22) || predicate(value.M13) || predicate(value.M23));
 }
Exemple #8
0
 public static Matrix2x3d Divide(Matrix2x3d matrix, double scalar)
 {
     return(new Matrix2x3d(matrix.M11 / scalar, matrix.M21 / scalar, matrix.M12 / scalar, matrix.M22 / scalar, matrix.M13 / scalar, matrix.M23 / scalar));
 }
Exemple #9
0
 /// <summary>
 /// Determines whether all elements of a matrix are non-zero.
 /// </summary>
 /// <param name="value">A matrix.</param>
 /// <returns>true if all elements are non-zero; false otherwise.</returns>
 public static bool All(Matrix2x3d value)
 {
     return(value.M11 != 0 && value.M21 != 0 && value.M12 != 0 && value.M22 != 0 && value.M13 != 0 && value.M23 != 0);
 }
Exemple #10
0
 public static Matrix2x4d Multiply(Matrix2x3d left, Matrix3x4d right)
 {
     return(new Matrix2x4d(left.M11 * right.M11 + left.M12 * right.M21 + left.M13 * right.M31, left.M21 * right.M11 + left.M22 * right.M21 + left.M23 * right.M31, left.M11 * right.M12 + left.M12 * right.M22 + left.M13 * right.M32, left.M21 * right.M12 + left.M22 * right.M22 + left.M23 * right.M32, left.M11 * right.M13 + left.M12 * right.M23 + left.M13 * right.M33, left.M21 * right.M13 + left.M22 * right.M23 + left.M23 * right.M33, left.M11 * right.M14 + left.M12 * right.M24 + left.M13 * right.M34, left.M21 * right.M14 + left.M22 * right.M24 + left.M23 * right.M34));
 }
Exemple #11
0
 public static Matrix2x3d Multiply(Matrix2x3d matrix, double scalar)
 {
     return(new Matrix2x3d(matrix.M11 * scalar, matrix.M21 * scalar, matrix.M12 * scalar, matrix.M22 * scalar, matrix.M13 * scalar, matrix.M23 * scalar));
 }
Exemple #12
0
 public static Matrix2x2d Multiply(Matrix2x3d left, Matrix3x2d right)
 {
     return(new Matrix2x2d(left.M11 * right.M11 + left.M12 * right.M21 + left.M13 * right.M31, left.M21 * right.M11 + left.M22 * right.M21 + left.M23 * right.M31, left.M11 * right.M12 + left.M12 * right.M22 + left.M13 * right.M32, left.M21 * right.M12 + left.M22 * right.M22 + left.M23 * right.M32));
 }
Exemple #13
0
 public static Matrix2x3d Subtract(Matrix2x3d left, Matrix2x3d right)
 {
     return(new Matrix2x3d(left.M11 - right.M11, left.M21 - right.M21, left.M12 - right.M12, left.M22 - right.M22, left.M13 - right.M13, left.M23 - right.M23));
 }
Exemple #14
0
 public static Matrix2x3d Add(Matrix2x3d left, Matrix2x3d right)
 {
     return(new Matrix2x3d(left.M11 + right.M11, left.M21 + right.M21, left.M12 + right.M12, left.M22 + right.M22, left.M13 + right.M13, left.M23 + right.M23));
 }
Exemple #15
0
 public static Matrix2x3d Negate(Matrix2x3d value)
 {
     return(new Matrix2x3d(-value.M11, -value.M21, -value.M12, -value.M22, -value.M13, -value.M23));
 }
Exemple #16
0
 public static Matrix2x3d Multiply(Matrix2x2d left, Matrix2x3d right)
 {
     return(new Matrix2x3d(left.M11 * right.M11 + left.M12 * right.M21, left.M21 * right.M11 + left.M22 * right.M21, left.M11 * right.M12 + left.M12 * right.M22, left.M21 * right.M12 + left.M22 * right.M22, left.M11 * right.M13 + left.M12 * right.M23, left.M21 * right.M13 + left.M22 * right.M23));
 }