Class Matrix2x2
Represents a 2x2 Matrix (contains only scale and rotation in 2D).
Inheritance
Implements
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
public sealed class Matrix2x2 : ValueType, IEquatable<Matrix2x2>, IFormattable
Constructors
Matrix2x2(Single)
Initializes a new instance of the Matrix2x2 struct.
Declaration
public Matrix2x2(float value)
Parameters
System. The value that will be assigned to all components. |
Matrix2x2(Single, Single, Single, Single)
Initializes a new instance of the Matrix2x2 struct.
Declaration
public Matrix2x2(float m11, float m12, float m21, float m22)
Parameters
System. The value to assign at row 1 column 1 of the Matrix2x2. |
System. The value to assign at row 1 column 2 of the Matrix2x2. |
System. The value to assign at row 2 column 1 of the Matrix2x2. |
System. The value to assign at row 2 column 2 of the Matrix2x2. |
Matrix2x2(Single[])
Initializes a new instance of the Matrix2x2 struct.
Declaration
public Matrix2x2(float[] values)
Parameters
System. The values to assign to the components of the Matrix2x2. This must be an array with four elements. |
Exceptions
System. Thrown when |
System. Thrown when |
Fields
Identity
M11
Value at row 1 column 1 of the Matrix2x2.
Declaration
public float M11
Field Value
System.
|
M12
Value at row 1 column 2 of the Matrix2x2.
Declaration
public float M12
Field Value
System.
|
M21
Value at row 2 column 1 of the Matrix2x2.
Declaration
public float M21
Field Value
System.
|
M22
Value at row 2 column 2 of the Matrix2x2.
Declaration
public float M22
Field Value
System.
|
SizeInBytes
The size of the Matrix2x2 type, in bytes.
Declaration
public static readonly int SizeInBytes
Field Value
System.
|
Zero
A Matrix2x2 with all of its components set to zero.
Declaration
public static readonly Matrix2x2 Zero
Field Value
Properties
Column1
Gets or sets the first column in the Matrix2x2; that is M11, M21
Declaration
public Float2 Column1 { get; set; }
Property Value
Column2
Gets or sets the second column in the Matrix2x2; that is M12, M22
Declaration
public Float2 Column2 { get; set; }
Property Value
IsIdentity
Gets a value indicating whether this instance is an identity Matrix2x2.
Declaration
public bool IsIdentity { get; }
Property Value
System.
|
Item[Int32]
Gets or sets the component at the specified index.
Declaration
public float this[int index] { get; set; }
Parameters
System. The zero-based index of the component to access. |
Property Value
System. The value of the Matrix2x2 component, depending on the index. |
Exceptions
System. Thrown when the |
Item[Int32, Int32]
Gets or sets the component at the specified index.
Declaration
public float this[int row, int column] { get; set; }
Parameters
System. The row of the Matrix2x2 to access. |
System. The column of the Matrix2x2 to access. |
Property Value
System. The value of the Matrix2x2 component, depending on the index. |
Exceptions
System. Thrown when the |
Row1
Gets or sets the first row in the Matrix2x2; that is M11, M12
Declaration
public Float2 Row1 { get; set; }
Property Value
Row2
Gets or sets the second row in the Matrix2x2; that is M21, M22
Declaration
public Float2 Row2 { get; set; }
Property Value
ScaleVector
Gets or sets the scale of the Matrix2x2; that is M11, M22.
Declaration
public Float2 ScaleVector { get; set; }
Property Value
Methods
Determinant()
Calculates the determinant of the Matrix2x2.
Declaration
public float Determinant()
Returns
System. The determinant of the Matrix2x2. |
Equals(Matrix2x2)
Determines whether the specified Matrix2x2 is equal to this instance.
Declaration
public bool Equals(Matrix2x2 other)
Parameters
Returns
System.
|
Equals(ref Matrix2x2)
Determines whether the specified Matrix2x2 is equal to this instance.
Declaration
public bool Equals(ref Matrix2x2 other)
Parameters
Returns
System.
|
Equals(ref Matrix2x2, ref Matrix2x2)
Determines whether the specified Matrix2x2 are equal.
Declaration
public static bool Equals(ref Matrix2x2 a, ref Matrix2x2 b)
Parameters
Returns
System.
|
Equals(Object)
Determines whether the specified System.
Declaration
public override bool Equals(object value)
Parameters
System. The System. |
Returns
System.
|
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System. A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
InverseDeterminant()
Calculates inverse of the determinant of the Matrix2x2.
Declaration
public float InverseDeterminant()
Returns
System. The inverse determinant of the Matrix2x2. |
Invert(ref Matrix2x2, out Matrix2x2)
Calculates the inverse of the specified Matrix2x2.
Declaration
public static void Invert(ref Matrix2x2 value, out Matrix2x2 result)
Parameters
Multiply(ref Matrix2x2, ref Matrix2x2, out Matrix2x2)
Determines the product of two matrices.
Declaration
public static void Multiply(ref Matrix2x2 left, ref Matrix2x2 right, out Matrix2x2 result)
Parameters
Rotation(Single, out Matrix2x2)
Creates the rotation matrix.
Declaration
public static void Rotation(float rotationRadians, out Matrix2x2 result)
Parameters
System. The rotation angle (in radians). |
Matrix2x2
result
The result. |
Scale(ref Float2, out Matrix2x2)
Creates the scale matrix.
Declaration
public static void Scale(ref Float2 scale, out Matrix2x2 result)
Parameters
Scale(Single, out Matrix2x2)
Creates the uniform scale matrix.
Declaration
public static void Scale(float scale, out Matrix2x2 result)
Parameters
System. The scale. |
Matrix2x2
result
The result. |
Scale(Single, Single, out Matrix2x2)
Creates the scale matrix.
Declaration
public static void Scale(float scaleX, float scaleY, out Matrix2x2 result)
Parameters
System. The scale x. |
System. The scale y. |
Matrix2x2
result
The result. |
Shear(ref Float2, out Matrix2x2)
Creates the shear matrix. Represented by: [1 Y] [X 1]
Declaration
public static void Shear(ref Float2 shearAngles, out Matrix2x2 result)
Parameters
ToArray()
Creates an array containing the elements of the Matrix2x2.
Declaration
public float[] ToArray()
Returns
System. A 4-element array containing the components of the Matrix2x2. |
ToString()
Returns a System.
Declaration
public override string ToString()
Returns
System. A System. |
ToString(IFormatProvider)
Returns a System.
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
System. The format provider. |
Returns
System. A System. |
ToString(String)
Returns a System.
Declaration
public string ToString(string format)
Parameters
System. The format. |
Returns
System. A System. |
ToString(String, IFormatProvider)
Returns a System.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
System. The format. |
System. The format provider. |
Returns
System. A System. |
Transform(ref Float2, ref Matrix2x2, out Float2)
Transforms the specified vector by the given matrix.
Declaration
public static void Transform(ref Float2 vector, ref Matrix2x2 matrix, out Float2 result)
Parameters
Operators
Equality(Matrix2x2, Matrix2x2)
Tests for equality between two objects.
Declaration
public static bool operator ==(Matrix2x2 left, Matrix2x2 right)
Parameters
Returns
System.
|
Explicit(Matrix to Matrix2x2)
Convert the 4x4 Matrix to a 3x3 Matrix.
Declaration
public static explicit operator Matrix2x2(Matrix value)
Parameters
Matrix
value
|
Returns
Matrix2x2
A 2x2 Matrix |
Explicit(Matrix2x2 to Matrix)
Convert the 2x2 Matrix to a 4x4 Matrix.
Declaration
public static explicit operator Matrix(Matrix2x2 value)
Parameters
Matrix2x2
value
|
Returns
Matrix
A 4x4 Matrix with zero translation and M44=1 |
Explicit(Matrix2x2 to Matrix3x3)
Convert the 2x2 Matrix to a 4x4 Matrix.
Declaration
public static explicit operator Matrix3x3(Matrix2x2 value)
Parameters
Matrix2x2
value
|
Returns
Matrix3x3
A 3x3 Matrix with zero translation and M44=1 |
Explicit(Matrix3x3 to Matrix2x2)
Convert the 3x3 Matrix to a 2x2 Matrix.
Declaration
public static explicit operator Matrix2x2(Matrix3x3 value)
Parameters
Matrix3x3
value
|
Returns
Matrix2x2
A 2x2 Matrix |
Inequality(Matrix2x2, Matrix2x2)
Tests for inequality between two objects.
Declaration
public static bool operator !=(Matrix2x2 left, Matrix2x2 right)
Parameters
Returns
System.
|