Struct Matrix3x2
Represents a 3x2 matrix.
Implements
Inherited Members
Namespace: OpenTK
Assembly: OpenTK.dll
Syntax
public struct Matrix3x2 : IEquatable<Matrix3x2>
Constructors
Matrix3x2(Vector2, Vector2, Vector2)
Constructs a new instance.
Declaration
public Matrix3x2(Vector2 row0, Vector2 row1, Vector2 row2)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | row0 | Top row of the matrix. |
Vector2 | row1 | Second row of the matrix. |
Vector2 | row2 | Bottom row of the matrix. |
Matrix3x2(Single, Single, Single, Single, Single, Single)
Constructs a new instance
Declaration
public Matrix3x2(float m00, float m01, float m10, float m11, float m20, float m21)
Parameters
Type | Name | Description |
---|---|---|
Single | m00 | First item of the first row of the matrix. |
Single | m01 | Second item of the first row of the matrix. |
Single | m10 | First item of the second row of the matrix. |
Single | m11 | Second item of the second row of the matrix. |
Single | m20 | First item of the third row of the matrix. |
Single | m21 | Second item of the third row of the matrix. |
Fields
Row0
Top row of the matrix.
Declaration
public Vector2 Row0
Field Value
Type | Description |
---|---|
Vector2 |
Row1
Second row of the matrix.
Declaration
public Vector2 Row1
Field Value
Type | Description |
---|---|
Vector2 |
Row2
Bottom row of the matrix.
Declaration
public Vector2 Row2
Field Value
Type | Description |
---|---|
Vector2 |
Zero
The zero matrix.
Declaration
public static readonly Matrix3x2 Zero
Field Value
Type | Description |
---|---|
Matrix3x2 |
Properties
Column0
Gets or sets the first column of this matrix.
Declaration
public Vector3 Column0 { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Column1
Gets or sets the second column of this matrix.
Declaration
public Vector3 Column1 { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Diagonal
Gets or sets the values along the main diagonal of the matrix.
Declaration
public Vector2 Diagonal { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
Item[Int32, Int32]
Gets or sets the value at a specified row and column.
Declaration
public float this[int rowIndex, int columnIndex] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | rowIndex | |
Int32 | columnIndex |
Property Value
Type | Description |
---|---|
Single |
M11
Gets or sets the value at row 1, column 1 of this instance.
Declaration
public float M11 { get; set; }
Property Value
Type | Description |
---|---|
Single |
M12
Gets or sets the value at row 1, column 2 of this instance.
Declaration
public float M12 { get; set; }
Property Value
Type | Description |
---|---|
Single |
M21
Gets or sets the value at row 2, column 1 of this instance.
Declaration
public float M21 { get; set; }
Property Value
Type | Description |
---|---|
Single |
M22
Gets or sets the value at row 2, column 2 of this instance.
Declaration
public float M22 { get; set; }
Property Value
Type | Description |
---|---|
Single |
M31
Gets or sets the value at row 3, column 1 of this instance.
Declaration
public float M31 { get; set; }
Property Value
Type | Description |
---|---|
Single |
M32
Gets or sets the value at row 3, column 2 of this instance.
Declaration
public float M32 { get; set; }
Property Value
Type | Description |
---|---|
Single |
Trace
Gets the trace of the matrix, the sum of the values along the diagonal.
Declaration
public readonly float Trace { get; }
Property Value
Type | Description |
---|---|
Single |
Methods
Add(Matrix3x2, Matrix3x2)
Adds two instances.
Declaration
public static Matrix3x2 Add(Matrix3x2 left, Matrix3x2 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the addition. |
Matrix3x2 | right | The right operand of the addition. |
Returns
Type | Description |
---|---|
Matrix3x2 | A new instance that is the result of the addition. |
Add(ref Matrix3x2, ref Matrix3x2, out Matrix3x2)
Adds two instances.
Declaration
public static void Add(ref Matrix3x2 left, ref Matrix3x2 right, out Matrix3x2 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the addition. |
Matrix3x2 | right | The right operand of the addition. |
Matrix3x2 | result | A new instance that is the result of the addition. |
CreateRotation(Single)
Builds a rotation matrix.
Declaration
public static Matrix3x2 CreateRotation(float angle)
Parameters
Type | Name | Description |
---|---|---|
Single | angle | The counter-clockwise angle in radians. |
Returns
Type | Description |
---|---|
Matrix3x2 | The resulting Matrix3x2 instance. |
CreateRotation(Single, out Matrix3x2)
Builds a rotation matrix.
Declaration
public static void CreateRotation(float angle, out Matrix3x2 result)
Parameters
Type | Name | Description |
---|---|---|
Single | angle | The counter-clockwise angle in radians. |
Matrix3x2 | result | The resulting Matrix3x2 instance. |
CreateScale(Vector2)
Creates a scale matrix.
Declaration
public static Matrix3x2 CreateScale(Vector2 scale)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | scale | Scale factors for the x and y axes. |
Returns
Type | Description |
---|---|
Matrix3x2 | A scale matrix. |
CreateScale(Vector2, out Matrix3x2)
Creates a scale matrix.
Declaration
public static void CreateScale(Vector2 scale, out Matrix3x2 result)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | scale | Scale factors for the x and y axes. |
Matrix3x2 | result | A scale matrix. |
CreateScale(Single)
Creates a scale matrix.
Declaration
public static Matrix3x2 CreateScale(float scale)
Parameters
Type | Name | Description |
---|---|---|
Single | scale | Single scale factor for the x and y axes. |
Returns
Type | Description |
---|---|
Matrix3x2 | A scale matrix. |
CreateScale(Single, out Matrix3x2)
Creates a scale matrix.
Declaration
public static void CreateScale(float scale, out Matrix3x2 result)
Parameters
Type | Name | Description |
---|---|---|
Single | scale | Single scale factor for the x, y, and z axes. |
Matrix3x2 | result | A scale matrix. |
CreateScale(Single, Single)
Creates a scale matrix.
Declaration
public static Matrix3x2 CreateScale(float x, float y)
Parameters
Type | Name | Description |
---|---|---|
Single | x | Scale factor for the x axis. |
Single | y | Scale factor for the y axis. |
Returns
Type | Description |
---|---|
Matrix3x2 | A scale matrix. |
CreateScale(Single, Single, out Matrix3x2)
Creates a scale matrix.
Declaration
public static void CreateScale(float x, float y, out Matrix3x2 result)
Parameters
Type | Name | Description |
---|---|---|
Single | x | Scale factor for the x axis. |
Single | y | Scale factor for the y axis. |
Matrix3x2 | result | A scale matrix. |
Equals(Matrix3x2)
Indicates whether the current matrix is equal to another matrix.
Declaration
public bool Equals(Matrix3x2 other)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | other | An matrix to compare with this matrix. |
Returns
Type | Description |
---|---|
Boolean | true if the current matrix is equal to the matrix parameter; otherwise, false. |
Equals(Object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object to compare to. |
Returns
Type | Description |
---|---|
Boolean | True if the instances are equal; false otherwise. |
Overrides
GetHashCode()
Returns the hashcode for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A System.Int32 containing the unique hashcode for this instance. |
Overrides
Mult(Matrix3x2, Matrix2)
Multiplies two instances.
Declaration
public static Matrix3x2 Mult(Matrix3x2 left, Matrix2 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the multiplication. |
Matrix2 | right | The right operand of the multiplication. |
Returns
Type | Description |
---|---|
Matrix3x2 | A new instance that is the result of the multiplication. |
Mult(Matrix3x2, Matrix2x3)
Multiplies two instances.
Declaration
public static Matrix3 Mult(Matrix3x2 left, Matrix2x3 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the multiplication. |
Matrix2x3 | right | The right operand of the multiplication. |
Returns
Type | Description |
---|---|
Matrix3 | A new instance that is the result of the multiplication. |
Mult(Matrix3x2, Matrix2x4)
Multiplies two instances.
Declaration
public static Matrix3x4 Mult(Matrix3x2 left, Matrix2x4 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the multiplication. |
Matrix2x4 | right | The right operand of the multiplication. |
Returns
Type | Description |
---|---|
Matrix3x4 | A new instance that is the result of the multiplication. |
Mult(Matrix3x2, Single)
Multiplies and instance by a scalar.
Declaration
public static Matrix3x2 Mult(Matrix3x2 left, float right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the multiplication. |
Single | right | The right operand of the multiplication. |
Returns
Type | Description |
---|---|
Matrix3x2 | A new instance that is the result of the multiplication. |
Mult(ref Matrix3x2, ref Matrix2, out Matrix3x2)
Multiplies two instances.
Declaration
public static void Mult(ref Matrix3x2 left, ref Matrix2 right, out Matrix3x2 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the multiplication. |
Matrix2 | right | The right operand of the multiplication. |
Matrix3x2 | result | A new instance that is the result of the multiplication. |
Mult(ref Matrix3x2, ref Matrix2x3, out Matrix3)
Multiplies two instances.
Declaration
public static void Mult(ref Matrix3x2 left, ref Matrix2x3 right, out Matrix3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the multiplication. |
Matrix2x3 | right | The right operand of the multiplication. |
Matrix3 | result | A new instance that is the result of the multiplication. |
Mult(ref Matrix3x2, ref Matrix2x4, out Matrix3x4)
Multiplies two instances.
Declaration
public static void Mult(ref Matrix3x2 left, ref Matrix2x4 right, out Matrix3x4 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the multiplication. |
Matrix2x4 | right | The right operand of the multiplication. |
Matrix3x4 | result | A new instance that is the result of the multiplication. |
Mult(ref Matrix3x2, Single, out Matrix3x2)
Multiplies and instance by a scalar.
Declaration
public static void Mult(ref Matrix3x2 left, float right, out Matrix3x2 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the multiplication. |
Single | right | The right operand of the multiplication. |
Matrix3x2 | result | A new instance that is the result of the multiplication. |
Subtract(Matrix3x2, Matrix3x2)
Subtracts two instances.
Declaration
public static Matrix3x2 Subtract(Matrix3x2 left, Matrix3x2 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the subtraction. |
Matrix3x2 | right | The right operand of the subtraction. |
Returns
Type | Description |
---|---|
Matrix3x2 | A new instance that is the result of the subtraction. |
Subtract(ref Matrix3x2, ref Matrix3x2, out Matrix3x2)
Subtracts two instances.
Declaration
public static void Subtract(ref Matrix3x2 left, ref Matrix3x2 right, out Matrix3x2 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The left operand of the subtraction. |
Matrix3x2 | right | The right operand of the subtraction. |
Matrix3x2 | result | A new instance that is the result of the subtraction. |
ToString()
Returns a System.String that represents the current Matrix3d.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | The string representation of the matrix. |
Overrides
Transpose(Matrix3x2)
Calculate the transpose of the given matrix.
Declaration
public static Matrix2x3 Transpose(Matrix3x2 mat)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | mat | The matrix to transpose. |
Returns
Type | Description |
---|---|
Matrix2x3 | The transpose of the given matrix. |
Transpose(ref Matrix3x2, out Matrix2x3)
Calculate the transpose of the given matrix.
Declaration
public static void Transpose(ref Matrix3x2 mat, out Matrix2x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | mat | The matrix to transpose. |
Matrix2x3 | result | The transpose of the given matrix. |
Operators
Addition(Matrix3x2, Matrix3x2)
Matrix addition
Declaration
public static Matrix3x2 operator +(Matrix3x2 left, Matrix3x2 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | left-hand operand |
Matrix3x2 | right | right-hand operand |
Returns
Type | Description |
---|---|
Matrix3x2 | A new Matrix3x2 which holds the result of the addition |
Equality(Matrix3x2, Matrix3x2)
Compares two instances for equality.
Declaration
public static bool operator ==(Matrix3x2 left, Matrix3x2 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The first instance. |
Matrix3x2 | right | The second instance. |
Returns
Type | Description |
---|---|
Boolean | True, if left equals right; false otherwise. |
Inequality(Matrix3x2, Matrix3x2)
Compares two instances for inequality.
Declaration
public static bool operator !=(Matrix3x2 left, Matrix3x2 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | The first instance. |
Matrix3x2 | right | The second instance. |
Returns
Type | Description |
---|---|
Boolean | True, if left does not equal right; false otherwise. |
Multiply(Matrix3x2, Matrix2)
Matrix multiplication
Declaration
public static Matrix3x2 operator *(Matrix3x2 left, Matrix2 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | left-hand operand |
Matrix2 | right | right-hand operand |
Returns
Type | Description |
---|---|
Matrix3x2 | A new Matrix3x2 which holds the result of the multiplication |
Multiply(Matrix3x2, Matrix2x3)
Matrix multiplication
Declaration
public static Matrix3 operator *(Matrix3x2 left, Matrix2x3 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | left-hand operand |
Matrix2x3 | right | right-hand operand |
Returns
Type | Description |
---|---|
Matrix3 | A new Matrix3 which holds the result of the multiplication |
Multiply(Matrix3x2, Matrix2x4)
Matrix multiplication
Declaration
public static Matrix3x4 operator *(Matrix3x2 left, Matrix2x4 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | left-hand operand |
Matrix2x4 | right | right-hand operand |
Returns
Type | Description |
---|---|
Matrix3x4 | A new Matrix3x4 which holds the result of the multiplication |
Multiply(Matrix3x2, Single)
Scalar multiplication.
Declaration
public static Matrix3x2 operator *(Matrix3x2 left, float right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | left-hand operand |
Single | right | right-hand operand |
Returns
Type | Description |
---|---|
Matrix3x2 | A new Matrix3x2 which holds the result of the multiplication |
Multiply(Single, Matrix3x2)
Scalar multiplication.
Declaration
public static Matrix3x2 operator *(float left, Matrix3x2 right)
Parameters
Type | Name | Description |
---|---|---|
Single | left | left-hand operand |
Matrix3x2 | right | right-hand operand |
Returns
Type | Description |
---|---|
Matrix3x2 | A new Matrix3x2 which holds the result of the multiplication |
Subtraction(Matrix3x2, Matrix3x2)
Matrix subtraction
Declaration
public static Matrix3x2 operator -(Matrix3x2 left, Matrix3x2 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x2 | left | left-hand operand |
Matrix3x2 | right | right-hand operand |
Returns
Type | Description |
---|---|
Matrix3x2 | A new Matrix3x2 which holds the result of the subtraction |