[]
Direct2D Matrix3x2 3x2.
public struct Matrix3x2 : IEquatable<Matrix3x2>, IFormattable
Initializes a new instance of the Matrix3x2 struct.
public Matrix3x2(float M11, float M12, float M21, float M22, float M31, float M32)
M11 floatThe value to assign at row 1 column 1 of the matrix.
M12 floatThe value to assign at row 1 column 2 of the matrix.
M21 floatThe value to assign at row 2 column 1 of the matrix.
M22 floatThe value to assign at row 2 column 2 of the matrix.
M31 floatThe value to assign at row 3 column 1 of the matrix.
M32 floatThe value to assign at row 3 column 2 of the matrix.
Initializes a new instance of the Matrix3x2 struct.
public Matrix3x2(float value)
value floatThe value that will be assigned to all components.
Initializes a new instance of the Matrix3x2 struct.
public Matrix3x2(float[] values)
values float[]The values to assign to the components of the matrix. This must be an array with six elements.
Thrown when values is null.
Thrown when values contains more or less than sixteen elements.
Gets the identity matrix.
public static readonly Matrix3x2 Identity
Element (1,1)
public float M11
Element (1,2)
public float M12
Element (2,1)
public float M21
Element (2,2)
public float M22
Element (3,1)
public float M31
Element (3,2)
public float M32
The size of the Matrix3x2 type, in bytes.
public const int SizeInBytes = 24
Gets or sets the first column in the matrix; that is M11, M21, M31.
public Vector3 Column1 { get; set; }
Gets or sets the second column in the matrix; that is M12, M22, and M32.
public Vector3 Column2 { get; set; }
Calculates the determinant of this matrix.
public float Determinant { get; }
Gets a value indicating whether this instance is an identity matrix.
public bool IsIdentity { get; }
Gets or sets the component at the specified index.
public float this[int row, int column] { get; set; }
row intThe row of the matrix to access.
column intThe column of the matrix to access.
The value of the matrix component, depending on the index.
Thrown when the row or columnis out of the range [0, 3].
Gets or sets the component at the specified index.
public float this[int index] { get; set; }
index intThe zero-based index of the component to access.
The value of the matrix component, depending on the index.
Thrown when the index is out of the range [0, 5].
Gets or sets the first row in the matrix; that is M11, M12.
public Vector2 Row1 { get; set; }
Gets or sets the second row in the matrix; that is M21, M22.
public Vector2 Row2 { get; set; }
Gets or sets the third row in the matrix; that is M31, M32.
public Vector2 Row3 { get; set; }
Gets or sets the scale of the matrix; that is M11, M22.
public Vector2 ScaleVector { get; set; }
Gets or sets the translation of the matrix; that is M31, M32.
public Vector2 TranslationVector { get; set; }
Determines the sum of two matrices.
public static Matrix3x2 Add(in Matrix3x2 left, in Matrix3x2 right)
The sum of the two matrices.
Divides a matrix by the given value.
public static Matrix3x2 Divide(in Matrix3x2 left, float right)
left Matrix3x2The matrix to scale.
right floatThe amount by which to scale.
The resulting matrix.
Determines whether the specified Matrix3x2 is equal to this instance.
public bool Equals(Matrix3x2 other)
other Matrix3x2Determines whether two instances of Matrix3x2 are equal.
public static bool Equals(in Matrix3x2 left, in Matrix3x2 right)
Determines whether the specified object is equal to this instance.
public override bool Equals(object value)
value objectReturns a hash code for this instance.
public override int GetHashCode()
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Element-wise division of two matrices.
public static Matrix3x2 HadamardDivide(in Matrix3x2 left, in Matrix3x2 right)
The result of division of the two matrices.
Determines the Hadamard (element-wise) product of two matrices.
public static Matrix3x2 HadamardProduct(in Matrix3x2 left, in Matrix3x2 right)
The Hadamard (element-wise) product of the two matrices.
Inverts the specified matrix.
public static Matrix3x2 Invert(in Matrix3x2 matrix)
matrix Matrix3x2Performs a linear interpolation between two matrices based on the given weighting.
public static Matrix3x2 Lerp(in Matrix3x2 matrix1, in Matrix3x2 matrix2, float amount)
matrix1 Matrix3x2The first matrix.
matrix2 Matrix3x2The second matrix.
amount floatA value between 0 and 1 that indicates the weight of matrix2.
The interpolated matrix.
Determines the product of two matrices.
public static Matrix3x2 Multiply(in Matrix3x2 left, in Matrix3x2 right)
The product of the two matrices.
Scales a matrix by the given value.
public static Matrix3x2 Multiply(in Matrix3x2 left, float right)
left Matrix3x2The matrix to scale.
right floatThe amount by which to scale.
The scaled matrix.
Negates a matrix in-place.
public static Matrix3x2 Negate(in Matrix3x2 value)
value Matrix3x2The matrix to be negated.
Negates a matrix in-place.
public static void NegateRef(ref Matrix3x2 value)
value Matrix3x2The matrix to be negated.
Creates a matrix that rotates.
public static Matrix3x2 Rotation(float degrees, Point2F center)
degrees floatcenter Point2FCreates a matrix that rotates.
public static Matrix3x2 Rotation(float degrees)
degrees floatAngle of rotation, in degrees. Angles are measured clockwise when looking along the rotation axis.
The created rotation matrix.
Creates a scale transformation matrix.
public static Matrix3x2 Scale(Size2F size, Point2F center)
Creates a scale transformation matrix.
public static Matrix3x2 Scale(Size2F size)
size Size2FCreates a scale transformation matrix.
public static Matrix3x2 Scale(Vector2 scales, Point2F center)
Creates a scale transformation matrix.
public static Matrix3x2 Scale(Vector2 scales)
scales Vector2Creates a scale transformation matrix.
public static Matrix3x2 Scale(float scale, Point2F center)
scale floatcenter Point2FCreates a scale transformation matrix.
public static Matrix3x2 Scale(float xScale, float yScale, Point2F center)
xScale floatyScale floatcenter Point2FCreates a scale transformation matrix.
public static Matrix3x2 Scale(float xScale, float yScale)
xScale floatyScale floatCreates a scale transformation matrix.
public static Matrix3x2 Scale(float scale)
scale floatCreates a skew transformation that has the specified x-axis angle, y-axis angle, and center point.
public static Matrix3x2 Skew(float radiansX, float radiansY, Point2F center)
radiansX floatradiansY floatcenter Point2FCreates a skew transformation that has the specified x-axis angle and y-axis angle in radians.
public static Matrix3x2 Skew(float radiansX, float radiansY)
radiansX floatradiansY floatDetermines the difference between two matrices.
public static Matrix3x2 Subtract(in Matrix3x2 left, in Matrix3x2 right)
The difference between the two matrices.
Creates an array containing the elements of the matrix.
public float[] ToArray()
A sixteen-element array containing the components of the matrix.
Returns a string that represents the current object.
public override string ToString()
Returns a string that represents this instance.
public string ToString(IFormatProvider formatProvider)
formatProvider System.IFormatProviderThe format provider.
A string that represents this instance.
Returns a string that represents this instance.
public string ToString(string format, IFormatProvider formatProvider)
format stringThe format.
formatProvider System.IFormatProviderThe format provider.
A string that represents this instance.
Returns a string that represents this instance.
public string ToString(string format)
format stringThe format.
A string that represents this instance.
Transforms a point by this matrix.
public static Point2F TransformPoint(in Matrix3x2 matrix, Point2F point)
matrix Matrix3x2The matrix to use as a tranformation matrix.
point Point2FThe original point to apply the transformation.
The result of the transformation for the input point.
Creates a translation matrix using the specified offsets.
public static Matrix3x2 Translation(Size2F value)
value Size2FThe offset for all three coordinate planes.
The created translation matrix.
Creates a translation matrix using the specified offsets.
public static Matrix3x2 Translation(Vector2 value)
value Vector2The offset for all three coordinate planes.
The created translation matrix.
Creates a translation matrix using the specified offsets.
public static Matrix3x2 Translation(float x, float y)
x floatX-coordinate offset.
y floatY-coordinate offset.
The created translation matrix.
Adds two matricies.
public static Matrix3x2 operator +(in Matrix3x2 left, in Matrix3x2 right)
The sum of the two matricies.
Divides a matrix by a given value.
public static Matrix3x2 operator /(in Matrix3x2 left, float right)
left Matrix3x2The matrix to divide.
right floatThe amount by which to divide.
The resulting matrix.
Tests for equality between two objects.
public static bool operator ==(in Matrix3x2 left, in Matrix3x2 right)
public static implicit operator Matrix3x2(Matrix4x4 matrix)
matrix Matrix4x4The matrix.
The result of the conversion.
Tests for inequality between two objects.
public static bool operator !=(in Matrix3x2 left, in Matrix3x2 right)
Calculates a matrix product for the given matrices.
public static Matrix3x2 operator *(in Matrix3x2 left, in Matrix3x2 right)
The result of the matrix multiplication.
Scales a matrix by a given value.
public static Matrix3x2 operator *(in Matrix3x2 left, float right)
left Matrix3x2The matrix to scale.
right floatThe amount by which to scale.
The scaled matrix.
Scales a matrix by a given value.
public static Matrix3x2 operator *(float left, in Matrix3x2 right)
left floatThe amount by which to scale.
right Matrix3x2The matrix to scale.
The scaled matrix.
Subtracts two matricies.
public static Matrix3x2 operator -(in Matrix3x2 left, in Matrix3x2 right)
The difference between the two matricies.
Negates a matrix.
public static Matrix3x2 operator -(in Matrix3x2 value)
value Matrix3x2The matrix to negate.
The negated matrix.