Struct Matrix3x3
Represents a 3x3 matrix.
Namespace: Evergine.Mathematics
Assembly: Evergine.Mathematics.dll
Syntax
public struct Matrix3x3
Constructors
Matrix3x3(float, float, float, float, float, float, float, float, float)
Initializes a new instance of the Matrix3x3 struct.
Declaration
public Matrix3x3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33)
Parameters
Type | Name | Description |
---|---|---|
float | m11 | The M11 value. |
float | m12 | The M12 value. |
float | m13 | The M13 value. |
float | m21 | The M21 value. |
float | m22 | The M22 value. |
float | m23 | The M23 value. |
float | m31 | The M31 value. |
float | m32 | The M32 value. |
float | m33 | The M33 value. |
Fields
M11
First row, first column.
Declaration
public float M11
Field Value
Type | Description |
---|---|
float |
M12
First row, second column.
Declaration
public float M12
Field Value
Type | Description |
---|---|
float |
M13
First row, third column.
Declaration
public float M13
Field Value
Type | Description |
---|---|
float |
M21
Second row, first column.
Declaration
public float M21
Field Value
Type | Description |
---|---|
float |
M22
Second row, second column.
Declaration
public float M22
Field Value
Type | Description |
---|---|
float |
M23
Second row, third column.
Declaration
public float M23
Field Value
Type | Description |
---|---|
float |
M31
Third row, first column.
Declaration
public float M31
Field Value
Type | Description |
---|---|
float |
M32
Third row, second column.
Declaration
public float M32
Field Value
Type | Description |
---|---|
float |
M33
Third row, third column.
Declaration
public float M33
Field Value
Type | Description |
---|---|
float |
Properties
Down
Gets or sets down.
Declaration
public Vector2 Down { get; set; }
Property Value
Type | Description |
---|---|
Vector2 | Down vector. |
Identity
Gets the identity.
Declaration
public static Matrix3x3 Identity { get; }
Property Value
Type | Description |
---|---|
Matrix3x3 |
IsIdentity
Gets a value indicating whether the matrix is an identity matrix.
Declaration
public bool IsIdentity { get; }
Property Value
Type | Description |
---|---|
bool |
Left
Gets or sets the left.
Declaration
public Vector2 Left { get; set; }
Property Value
Type | Description |
---|---|
Vector2 | The left. |
Right
Gets or sets the right.
Declaration
public Vector2 Right { get; set; }
Property Value
Type | Description |
---|---|
Vector2 | The right. |
Rotation
Gets the roll angle.
Declaration
public float Rotation { get; }
Property Value
Type | Description |
---|---|
float |
Scale
Gets the scale vector from the matrix.
Declaration
public Vector2 Scale { get; }
Property Value
Type | Description |
---|---|
Vector2 |
Translation
Gets or sets the translation.
Declaration
public Vector2 Translation { get; set; }
Property Value
Type | Description |
---|---|
Vector2 | The translation. |
Up
Gets or sets up.
Declaration
public Vector2 Up { get; set; }
Property Value
Type | Description |
---|---|
Vector2 | Up vector. |
Methods
Add(Matrix3x3, Matrix3x3)
Adds the specified matrix1.
Declaration
public static Matrix3x3 Add(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Add(ref Matrix3x3, ref Matrix3x3, out Matrix3x3)
Adds the specified matrix1.
Declaration
public static void Add(ref Matrix3x3 matrix1, ref Matrix3x3 matrix2, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Matrix3x3 | result | The resulting matrix. |
CreateFromQuaternion(Quaternion)
Creates from quaternion.
Declaration
public static Matrix3x3 CreateFromQuaternion(Quaternion quaternion)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quaternion | The quaternion. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
CreateFromQuaternion(ref Quaternion, out Matrix3x3)
Creates from a quaternion.
Declaration
public static void CreateFromQuaternion(ref Quaternion quaternion, out Matrix3x3 matrix)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quaternion | The quaternion. |
Matrix3x3 | matrix | The matrix. |
CreateRotation(Vector2, float)
Creates the rotation.
Declaration
public static Matrix3x3 CreateRotation(Vector2 translate, float angle)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | translate | The translation. |
float | angle | The angle. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
CreateRotation(float)
Creates the rotation.
Declaration
public static Matrix3x3 CreateRotation(float angle)
Parameters
Type | Name | Description |
---|---|---|
float | angle | The angle. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
CreateScale(Vector2)
Creates the scale.
Declaration
public static Matrix3x3 CreateScale(Vector2 scales)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | scales | The scales. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
CreateScale(ref Vector2, out Matrix3x3)
Creates the scale.
Declaration
public static void CreateScale(ref Vector2 scales, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | scales | The scales. |
Matrix3x3 | result | The result. |
CreateScale(float)
Creates the scale.
Declaration
public static Matrix3x3 CreateScale(float scale)
Parameters
Type | Name | Description |
---|---|---|
float | scale | The scale. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
CreateScale(float, out Matrix3x3)
Creates the scale.
Declaration
public static void CreateScale(float scale, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
float | scale | The scale. |
Matrix3x3 | result | The result. |
CreateScale(float, float)
Creates the scale.
Declaration
public static Matrix3x3 CreateScale(float xScale, float yScale)
Parameters
Type | Name | Description |
---|---|---|
float | xScale | The x scale. |
float | yScale | The y scale. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
CreateScale(float, float, out Matrix3x3)
Creates the scale.
Declaration
public static void CreateScale(float xScale, float yScale, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
float | xScale | The x scale. |
float | yScale | The y scale. |
Matrix3x3 | result | The result. |
CreateTransform(Vector2, float, Vector2)
Creates a transformation matrix.
Declaration
public static Matrix3x3 CreateTransform(Vector2 translate, float angle, Vector2 scale)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | translate | 2D translation. |
float | angle | Rotation angle. |
Vector2 | scale | Axis scale. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
CreateTransform(Vector2, float, float)
Creates a transform matrix.
Declaration
public static Matrix3x3 CreateTransform(Vector2 translate, float angle, float scale)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | translate | 2D translation. |
float | angle | Rotation angle. |
float | scale | Axis scale. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
CreateTranslation(Vector2)
Creates the translation.
Declaration
public static Matrix3x3 CreateTranslation(Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
CreateTranslation(ref Vector2, out Matrix3x3)
Creates the translation.
Declaration
public static void CreateTranslation(ref Vector2 position, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The position. |
Matrix3x3 | result | The result. |
CreateTranslation(float, float)
Creates the translation.
Declaration
public static Matrix3x3 CreateTranslation(float xPosition, float yPosition)
Parameters
Type | Name | Description |
---|---|---|
float | xPosition | The x-position. |
float | yPosition | The y-position. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
CreateTranslation(float, float, out Matrix3x3)
Creates the translation.
Declaration
public static void CreateTranslation(float xPosition, float yPosition, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
float | xPosition | The X position. |
float | yPosition | The Y position. |
Matrix3x3 | result | The result. |
Determinant()
Determines this instance.
Declaration
public float Determinant()
Returns
Type | Description |
---|---|
float | The result. |
Equals(Matrix3x3)
Compares the specified object to this instance.
Declaration
public bool Equals(Matrix3x3 other)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | other | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool | The comparison result. |
Equals(ref Matrix3x3)
Compares the specified other object for equality.
Declaration
public bool Equals(ref Matrix3x3 other)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | other | The other object to compare. |
Returns
Type | Description |
---|---|
bool | The result of the comparison. |
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
Invert(Matrix3x3)
Inverts the specified matrix.
Declaration
public static Matrix3x3 Invert(Matrix3x3 matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix | The matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Invert(ref Matrix3x3, out Matrix3x3)
Inverts the specified matrix.
Declaration
public static bool Invert(ref Matrix3x3 matrix, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix | The matrix. |
Matrix3x3 | result | The result. |
Returns
Type | Description |
---|---|
bool | True if everything is ok. |
Lerp(Matrix3x3, Matrix3x3, float)
Lerps the specified matrix1.
Declaration
public static Matrix3x3 Lerp(Matrix3x3 matrix1, Matrix3x3 matrix2, float amount)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
float | amount | The interpolation amount. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Lerp(ref Matrix3x3, ref Matrix3x3, float, out Matrix3x3)
Lerps the specified matrix1.
Declaration
public static void Lerp(ref Matrix3x3 matrix1, ref Matrix3x3 matrix2, float amount, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
float | amount | The interpolation amount. |
Matrix3x3 | result | The resulting matrix. |
Multiply(Matrix3x3, Matrix3x3)
Multiplies the specified matrix.
Declaration
public static Matrix3x3 Multiply(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Multiply(Matrix3x3, float)
Multiplies the specified matrix.
Declaration
public static Matrix3x3 Multiply(Matrix3x3 matrix1, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The matrix. |
float | scaleFactor | The scale factor. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Multiply(ref Matrix3x3, ref Matrix3x3, out Matrix3x3)
Multiplies the specified matrix.
Declaration
public static void Multiply(ref Matrix3x3 matrix1, ref Matrix3x3 matrix2, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Matrix3x3 | result | The result. |
Multiply(ref Matrix3x3, float, out Matrix3x3)
Multiplies the specified matrix.
Declaration
public static void Multiply(ref Matrix3x3 matrix, float scaleFactor, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix | The matrix. |
float | scaleFactor | The scale factor. |
Matrix3x3 | result | The result. |
Negate(Matrix3x3)
Negates the specified matrix.
Declaration
public static Matrix3x3 Negate(Matrix3x3 matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix | The matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Negate(ref Matrix3x3, out Matrix3x3)
Negates the specified matrix.
Declaration
public static void Negate(ref Matrix3x3 matrix, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix | The matrix. |
Matrix3x3 | result | The result. |
SetSameDiagonal(float)
Sets the same diagonal values in the matrix.
Declaration
public void SetSameDiagonal(float d)
Parameters
Type | Name | Description |
---|---|---|
float | d | The diagonal value. |
Subtract(Matrix3x3, Matrix3x3)
Subtracts the specified matrix1.
Declaration
public static Matrix3x3 Subtract(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Subtract(ref Matrix3x3, ref Matrix3x3, out Matrix3x3)
Subtracts the specified matrix.
Declaration
public static void Subtract(ref Matrix3x3 matrix1, ref Matrix3x3 matrix2, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Matrix3x3 | result | The resulting matrix. |
ToMatrix4x4(Matrix3x3)
Creates a 4x4 matrix from a 3x3 matrix.
Declaration
public static Matrix4x4 ToMatrix4x4(Matrix3x3 a)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | a | 3x3 matrix. |
Returns
Type | Description |
---|---|
Matrix4x4 | Created 4x4 matrix. |
ToMatrix4x4(ref Matrix3x3, out Matrix4x4)
Creates a 4x4 matrix from a 3x3 matrix.
Declaration
public static void ToMatrix4x4(ref Matrix3x3 a, out Matrix4x4 b)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | a | 3x3 matrix. |
Matrix4x4 | b | 4x4 matrix that is created. |
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents this instance. |
Overrides
Transpose(Matrix3x3)
Transposes the specified matrix.
Declaration
public static Matrix3x3 Transpose(Matrix3x3 matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix | The matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Transpose(ref Matrix3x3, out Matrix3x3)
Transposes the specified matrix.
Declaration
public static void Transpose(ref Matrix3x3 matrix, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix | The matrix. |
Matrix3x3 | result | The result. |
Operators
operator +(Matrix3x3, Matrix3x3)
Implements the operator +.
Declaration
public static Matrix3x3 operator +(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operation. |
operator /(Matrix3x3, Matrix3x3)
Implements the operator /.
Declaration
public static Matrix3x3 operator /(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operator. |
operator /(Matrix3x3, float)
Implements the operator /.
Declaration
public static Matrix3x3 operator /(Matrix3x3 matrix, float divider)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix | The matrix. |
float | divider | The divisor. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operation. |
operator ==(Matrix3x3, Matrix3x3)
Implements the operator ==.
Declaration
public static bool operator ==(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
operator !=(Matrix3x3, Matrix3x3)
Implements the operator !=.
Declaration
public static bool operator !=(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
operator *(Matrix3x3, Matrix3x3)
Implements the operator *.
Declaration
public static Matrix3x3 operator *(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operation. |
operator *(Matrix3x3, float)
Implements the operator *.
Declaration
public static Matrix3x3 operator *(Matrix3x3 matrix, float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix | The matrix. |
float | scaleFactor | The scale factor. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operation. |
operator *(float, Matrix3x3)
Implements the operator *.
Declaration
public static Matrix3x3 operator *(float scaleFactor, Matrix3x3 matrix)
Parameters
Type | Name | Description |
---|---|---|
float | scaleFactor | The scale factor. |
Matrix3x3 | matrix | The matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operation. |
operator -(Matrix3x3, Matrix3x3)
Implements the operator -.
Declaration
public static Matrix3x3 operator -(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Matrix3x3 | matrix2 | The second matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operator. |
operator -(Matrix3x3)
Implements the operator -.
Declaration
public static Matrix3x3 operator -(Matrix3x3 matrix1)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The first matrix. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operator. |