Struct Matrix2x4d
Represents a 2x4 matrix.
Inherited Members
Namespace: OpenTK.Mathematics
Assembly: OpenTK.Mathematics.dll
Syntax
[Serializable]
public struct Matrix2x4d : IEquatable<Matrix2x4d>, IFormattable
Constructors
Matrix2x4d(Vector4d, Vector4d)
Initializes a new instance of the Matrix2x4d struct.
Declaration
public Matrix2x4d(Vector4d row0, Vector4d row1)
Parameters
Type | Name | Description |
---|---|---|
Vector4d | row0 | Top row of the matrix. |
Vector4d | row1 | Bottom row of the matrix. |
Matrix2x4d(double, double, double, double, double, double, double, double)
Initializes a new instance of the Matrix2x4d struct.
Declaration
public Matrix2x4d(double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13)
Parameters
Type | Name | Description |
---|---|---|
double | m00 | First item of the first row of the matrix. |
double | m01 | Second item of the first row of the matrix. |
double | m02 | Third item of the first row of the matrix. |
double | m03 | Fourth item of the first row of the matrix. |
double | m10 | First item of the second row of the matrix. |
double | m11 | Second item of the second row of the matrix. |
double | m12 | Third item of the second row of the matrix. |
double | m13 | Fourth item of the second row of the matrix. |
Fields
Row0
Top row of the matrix.
Declaration
public Vector4d Row0
Field Value
Type | Description |
---|---|
Vector4d |
Row1
Bottom row of the matrix.
Declaration
public Vector4d Row1
Field Value
Type | Description |
---|---|
Vector4d |
Zero
The zero matrix.
Declaration
public static readonly Matrix2x4d Zero
Field Value
Type | Description |
---|---|
Matrix2x4d |
Properties
Column0
Gets or sets the first column of the matrix.
Declaration
public Vector2d Column0 { get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Column1
Gets or sets the second column of the matrix.
Declaration
public Vector2d Column1 { get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Column2
Gets or sets the third column of the matrix.
Declaration
public Vector2d Column2 { get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Column3
Gets or sets the fourth column of the matrix.
Declaration
public Vector2d Column3 { get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
Diagonal
Gets or sets the values along the main diagonal of the matrix.
Declaration
public Vector2d Diagonal { get; set; }
Property Value
Type | Description |
---|---|
Vector2d |
this[int, int]
Gets or sets the value at a specified row and column.
Declaration
public double this[int rowIndex, int columnIndex] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
int | rowIndex | The index of the row. |
int | columnIndex | The index of the column. |
Property Value
Type | Description |
---|---|
double | The element at the given row and column index. |
M11
Gets or sets the value at row 1, column 1 of this instance.
Declaration
public double M11 { get; set; }
Property Value
Type | Description |
---|---|
double |
M12
Gets or sets the value at row 1, column 2 of this instance.
Declaration
public double M12 { get; set; }
Property Value
Type | Description |
---|---|
double |
M13
Gets or sets the value at row 1, column 3 of this instance.
Declaration
public double M13 { get; set; }
Property Value
Type | Description |
---|---|
double |
M14
Gets or sets the value at row 1, column 4 of this instance.
Declaration
public double M14 { get; set; }
Property Value
Type | Description |
---|---|
double |
M21
Gets or sets the value at row 2, column 1 of this instance.
Declaration
public double M21 { get; set; }
Property Value
Type | Description |
---|---|
double |
M22
Gets or sets the value at row 2, column 2 of this instance.
Declaration
public double M22 { get; set; }
Property Value
Type | Description |
---|---|
double |
M23
Gets or sets the value at row 2, column 3 of this instance.
Declaration
public double M23 { get; set; }
Property Value
Type | Description |
---|---|
double |
M24
Gets or sets the value at row 2, column 4 of this instance.
Declaration
public double M24 { get; set; }
Property Value
Type | Description |
---|---|
double |
Trace
Gets the trace of the matrix, the sum of the values along the diagonal.
Declaration
public double Trace { get; }
Property Value
Type | Description |
---|---|
double |
Methods
Add(Matrix2x4d, Matrix2x4d)
Adds two instances.
Declaration
[Pure]
public static Matrix2x4d Add(Matrix2x4d left, Matrix2x4d right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the addition. |
Matrix2x4d | right | The right operand of the addition. |
Returns
Type | Description |
---|---|
Matrix2x4d | A new instance that is the result of the addition. |
Add(in Matrix2x4d, in Matrix2x4d, out Matrix2x4d)
Adds two instances.
Declaration
public static void Add(in Matrix2x4d left, in Matrix2x4d right, out Matrix2x4d result)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the addition. |
Matrix2x4d | right | The right operand of the addition. |
Matrix2x4d | result | A new instance that is the result of the addition. |
CreateRotation(double, out Matrix2x4d)
Builds a rotation matrix.
Declaration
public static void CreateRotation(double angle, out Matrix2x4d result)
Parameters
Type | Name | Description |
---|---|---|
double | angle | The counter-clockwise angle in radians. |
Matrix2x4d | result | The resulting Matrix2x4d instance. |
CreateRotation(double)
Builds a rotation matrix.
Declaration
[Pure]
public static Matrix2x4d CreateRotation(double angle)
Parameters
Type | Name | Description |
---|---|---|
double | angle | The counter-clockwise angle in radians. |
Returns
Type | Description |
---|---|
Matrix2x4d | The resulting Matrix2x3d instance. |
CreateScale(Vector2d, out Matrix2x4d)
Creates a scale matrix.
Declaration
public static void CreateScale(Vector2d scale, out Matrix2x4d result)
Parameters
Type | Name | Description |
---|---|---|
Vector2d | scale | Scale factors for the x and y axes. |
Matrix2x4d | result | A scale matrix. |
CreateScale(Vector2d)
Creates a scale matrix.
Declaration
[Pure]
public static Matrix2x4d CreateScale(Vector2d scale)
Parameters
Type | Name | Description |
---|---|---|
Vector2d | scale | Scale factors for the x and y axes. |
Returns
Type | Description |
---|---|
Matrix2x4d | A scale matrix. |
CreateScale(double, out Matrix2x4d)
Creates a scale matrix.
Declaration
public static void CreateScale(double scale, out Matrix2x4d result)
Parameters
Type | Name | Description |
---|---|---|
double | scale | Single scale factor for the x, y, and z axes. |
Matrix2x4d | result | A scale matrix. |
CreateScale(double, double, out Matrix2x4d)
Creates a scale matrix.
Declaration
public static void CreateScale(double x, double y, out Matrix2x4d result)
Parameters
Type | Name | Description |
---|---|---|
double | x | Scale factor for the x axis. |
double | y | Scale factor for the y axis. |
Matrix2x4d | result | A scale matrix. |
CreateScale(double, double)
Creates a scale matrix.
Declaration
[Pure]
public static Matrix2x4d CreateScale(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
double | x | Scale factor for the x axis. |
double | y | Scale factor for the y axis. |
Returns
Type | Description |
---|---|
Matrix2x4d | A scale matrix. |
CreateScale(double)
Creates a scale matrix.
Declaration
[Pure]
public static Matrix2x4d CreateScale(double scale)
Parameters
Type | Name | Description |
---|---|---|
double | scale | Single scale factor for the x and y axes. |
Returns
Type | Description |
---|---|
Matrix2x4d | A scale matrix. |
Equals(Matrix2x4d)
Indicates whether the current matrix is equal to another matrix.
Declaration
[Pure]
public bool Equals(Matrix2x4d other)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | other | An matrix to compare with this matrix. |
Returns
Type | Description |
---|---|
bool | 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
[Pure]
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare to. |
Returns
Type | Description |
---|---|
bool | True if the instances are equal; false otherwise. |
Overrides
GetHashCode()
Returns the hashcode for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A System.Int32 containing the unique hashcode for this instance. |
Overrides
Mult(Matrix2x4d, Matrix4)
Multiplies two instances.
Declaration
[Pure]
public static Matrix2x4d Mult(Matrix2x4d left, Matrix4 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the multiplication. |
Matrix4 | right | The right operand of the multiplication. |
Returns
Type | Description |
---|---|
Matrix2x4d | A new instance that is the result of the multiplication. |
Mult(Matrix2x4d, Matrix4x2)
Multiplies two instances.
Declaration
[Pure]
public static Matrix2d Mult(Matrix2x4d left, Matrix4x2 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the multiplication. |
Matrix4x2 | right | The right operand of the multiplication. |
Returns
Type | Description |
---|---|
Matrix2d | A new instance that is the result of the multiplication. |
Mult(Matrix2x4d, Matrix4x3)
Multiplies two instances.
Declaration
[Pure]
public static Matrix2x3d Mult(Matrix2x4d left, Matrix4x3 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the multiplication. |
Matrix4x3 | right | The right operand of the multiplication. |
Returns
Type | Description |
---|---|
Matrix2x3d | A new instance that is the result of the multiplication. |
Mult(Matrix2x4d, double)
Multiplies and instance by a scalar.
Declaration
[Pure]
public static Matrix2x4d Mult(Matrix2x4d left, double right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the multiplication. |
double | right | The right operand of the multiplication. |
Returns
Type | Description |
---|---|
Matrix2x4d | A new instance that is the result of the multiplication. |
Mult(in Matrix2x4d, in Matrix4, out Matrix2x4d)
Multiplies two instances.
Declaration
public static void Mult(in Matrix2x4d left, in Matrix4 right, out Matrix2x4d result)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the multiplication. |
Matrix4 | right | The right operand of the multiplication. |
Matrix2x4d | result | A new instance that is the result of the multiplication. |
Mult(in Matrix2x4d, in Matrix4x2, out Matrix2d)
Multiplies two instances.
Declaration
public static void Mult(in Matrix2x4d left, in Matrix4x2 right, out Matrix2d result)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the multiplication. |
Matrix4x2 | right | The right operand of the multiplication. |
Matrix2d | result | A new instance that is the result of the multiplication. |
Mult(in Matrix2x4d, in Matrix4x3, out Matrix2x3d)
Multiplies two instances.
Declaration
public static void Mult(in Matrix2x4d left, in Matrix4x3 right, out Matrix2x3d result)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the multiplication. |
Matrix4x3 | right | The right operand of the multiplication. |
Matrix2x3d | result | A new instance that is the result of the multiplication. |
Mult(in Matrix2x4d, double, out Matrix2x4d)
Multiplies and instance by a scalar.
Declaration
public static void Mult(in Matrix2x4d left, double right, out Matrix2x4d result)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the multiplication. |
double | right | The right operand of the multiplication. |
Matrix2x4d | result | A new instance that is the result of the multiplication. |
Subtract(Matrix2x4d, Matrix2x4d)
Subtracts two instances.
Declaration
[Pure]
public static Matrix2x4d Subtract(Matrix2x4d left, Matrix2x4d right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the subtraction. |
Matrix2x4d | right | The right operand of the subtraction. |
Returns
Type | Description |
---|---|
Matrix2x4d | A new instance that is the result of the subtraction. |
Subtract(in Matrix2x4d, in Matrix2x4d, out Matrix2x4d)
Subtracts two instances.
Declaration
public static void Subtract(in Matrix2x4d left, in Matrix2x4d right, out Matrix2x4d result)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The left operand of the subtraction. |
Matrix2x4d | right | The right operand of the subtraction. |
Matrix2x4d | result | A new instance that is the result of the subtraction. |
ToString()
Returns a System.String that represents the current Matrix4.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The string representation of the matrix. |
Overrides
ToString(IFormatProvider)
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
string |
ToString(string, IFormatProvider)
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
string | format | |
IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
string |
ToString(string)
Declaration
public string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
string | format |
Returns
Type | Description |
---|---|
string |
Transpose(Matrix2x4d)
Calculate the transpose of the given matrix.
Declaration
[Pure]
public static Matrix4x2d Transpose(Matrix2x4d mat)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | mat | The matrix to transpose. |
Returns
Type | Description |
---|---|
Matrix4x2d | The transpose of the given matrix. |
Transpose(in Matrix2x4d, out Matrix4x2d)
Calculate the transpose of the given matrix.
Declaration
public static void Transpose(in Matrix2x4d mat, out Matrix4x2d result)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | mat | The matrix to transpose. |
Matrix4x2d | result | The transpose of the given matrix. |
Operators
operator +(Matrix2x4d, Matrix2x4d)
Matrix addition.
Declaration
[Pure]
public static Matrix2x4d operator +(Matrix2x4d left, Matrix2x4d right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | left-hand operand. |
Matrix2x4d | right | right-hand operand. |
Returns
Type | Description |
---|---|
Matrix2x4d | A new Matrix2d which holds the result of the addition. |
operator ==(Matrix2x4d, Matrix2x4d)
Compares two instances for equality.
Declaration
[Pure]
public static bool operator ==(Matrix2x4d left, Matrix2x4d right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The first instance. |
Matrix2x4d | right | The second instance. |
Returns
Type | Description |
---|---|
bool | True, if left equals right; false otherwise. |
operator !=(Matrix2x4d, Matrix2x4d)
Compares two instances for inequality.
Declaration
[Pure]
public static bool operator !=(Matrix2x4d left, Matrix2x4d right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | The first instance. |
Matrix2x4d | right | The second instance. |
Returns
Type | Description |
---|---|
bool | True, if left does not equal right; false otherwise. |
operator *(Matrix2x4d, Matrix4)
Matrix multiplication.
Declaration
[Pure]
public static Matrix2x4d operator *(Matrix2x4d left, Matrix4 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | left-hand operand. |
Matrix4 | right | right-hand operand. |
Returns
Type | Description |
---|---|
Matrix2x4d | A new Matrix2x4d which holds the result of the multiplication. |
operator *(Matrix2x4d, Matrix4x2)
Matrix multiplication.
Declaration
[Pure]
public static Matrix2d operator *(Matrix2x4d left, Matrix4x2 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | left-hand operand. |
Matrix4x2 | right | right-hand operand. |
Returns
Type | Description |
---|---|
Matrix2d | A new Matrix2d which holds the result of the multiplication. |
operator *(Matrix2x4d, Matrix4x3)
Matrix multiplication.
Declaration
[Pure]
public static Matrix2x3d operator *(Matrix2x4d left, Matrix4x3 right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | left-hand operand. |
Matrix4x3 | right | right-hand operand. |
Returns
Type | Description |
---|---|
Matrix2x3d | A new Matrix2x3d which holds the result of the multiplication. |
operator *(Matrix2x4d, double)
Scalar multiplication.
Declaration
[Pure]
public static Matrix2x4d operator *(Matrix2x4d left, double right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | left-hand operand. |
double | right | right-hand operand. |
Returns
Type | Description |
---|---|
Matrix2x4d | A new Matrix2x4d which holds the result of the multiplication. |
operator *(double, Matrix2x4d)
Scalar multiplication.
Declaration
[Pure]
public static Matrix2x4d operator *(double left, Matrix2x4d right)
Parameters
Type | Name | Description |
---|---|---|
double | left | left-hand operand. |
Matrix2x4d | right | right-hand operand. |
Returns
Type | Description |
---|---|
Matrix2x4d | A new Matrix2x4d which holds the result of the multiplication. |
operator -(Matrix2x4d, Matrix2x4d)
Matrix subtraction.
Declaration
[Pure]
public static Matrix2x4d operator -(Matrix2x4d left, Matrix2x4d right)
Parameters
Type | Name | Description |
---|---|---|
Matrix2x4d | left | left-hand operand. |
Matrix2x4d | right | right-hand operand. |
Returns
Type | Description |
---|---|
Matrix2x4d | A new Matrix2x4d which holds the result of the subtraction. |