Matrix2x2f
Summary
Represents a 2x2 single-precision floating-point matrix arranged in row-major layout.
Definition
Namespace: SDT4.Managed.Core.Math
Assembly: SDT4.Managed.Core.dll
struct Matrix2x2f
Implements:
IMatrixSpatial<Single, Vector2f, Matrix2x2f>, ISerializable, IEquatable<Matrix2x2f>
Fields
| Name | Type | Description |
|---|---|---|
public m00 |
Single | Value at row 0, column 0. |
public m01 |
Single | Value at row 0, column 1. |
public m10 |
Single | Value at row 1, column 0. |
public m11 |
Single | Value at row 1, column 1. |
Properties
| Name | Type | Description |
|---|---|---|
public static get; Zero |
Matrix2x2f | Gets a 2x2 matrix with all elements set to zero. |
public static get; Identity |
Matrix2x2f | Gets the 2x2 multiplicative identity matrix. |
public get; Item |
Single | Gets the element at the specified row and column indices. |
public get; Item |
Vector2f | Gets the row vector at the specified index. |
public get; IsOrthoNormal |
Boolean | Gets a value indicating whether the matrix basis vectors are mutually orthogonal and normalised to unit length. |
Methods
public static Matrix2x2f FromColumns(Vector2f col0, Vector2f col1)
Summary: Constructs a 2x2 matrix from column vectors.
Parameters:
Returns:
- Matrix2x2f: A matrix containing the column vectors.
public static Matrix2x2f FromRows(Vector2f row0, Vector2f row1)
Summary: Constructs a 2x2 matrix from row vectors.
Parameters:
Returns:
- Matrix2x2f: A matrix containing the row vectors.
public Vector2f GetColumn(Int32 col)
Summary: Retrieves the column vector at the specified index.
Parameters:
col(Int32): The zero-based column index (0 to 1).
Returns:
- Vector2f: The column vector.
public Vector2f GetRow(Int32 row)
Summary: Retrieves the row vector at the specified index.
Parameters:
row(Int32): The zero-based row index (0 to 1).
Returns:
- Vector2f: The row vector.
public Void SetColumn(Int32 col, Vector2f vec)
Summary: Sets the column vector at the specified index.
Parameters:
-
col(Int32): The zero-based column index (0 to 1). -
vec(Vector2f): The vector to assign to the column.
public Void SetRow(Int32 row, Vector2f vec)
Summary: Sets the row vector at the specified index.
Parameters:
public Single Determinant()
Summary: Calculates the scalar determinant of the 2x2 matrix.
Returns:
- Single: The determinant value.
public Matrix2x2f Transposed()
Summary: Returns a transposed copy of the matrix with rows and columns swapped.
Returns:
- Matrix2x2f: The transposed matrix.
public Matrix2x2f Inverse()
Summary: Calculates the multiplicative inverse of the matrix.
Returns:
- Matrix2x2f: The inverted matrix.
public Boolean Equals(Matrix2x2f other)
Summary: Determines whether the specified Matrix2x2f is equal to the current instance.
Parameters:
other(Matrix2x2f): The matrix to compare with this instance.
Returns:
- Boolean:
if all corresponding elements are equal; otherwise, .
public virtual Boolean Equals(Object? obj)
Summary: Determines whether the specified object is a Matrix2x2f and is equal to the current instance.
Parameters:
obj(Object?): The object to compare with this instance.
Returns:
- Boolean:
if the object is a Matrix2x2f and matches all elements; otherwise, .
public virtual Int32 GetHashCode()
Summary: Returns the hash code for this matrix.
Returns:
- Int32: A 32-bit signed integer hash code.
public virtual String ToString()
Summary: Returns a culture-invariant string representation of the matrix.
Returns:
- String: A formatted string displaying the matrix rows.
public Void GetObjectData(SerializationInfo info, StreamingContext context)
Summary: Populates a SerializationInfo with the data needed to serialise the matrix.
Parameters:
-
info(SerializationInfo): The SerializationInfo to populate with data. -
context(StreamingContext): The destination for this serialisation.