Struct Matrix3x3
Represents a 3x3 matrix.
Implements
Inherited Members
Namespace: Evergine.Mathematics
Assembly: Evergine.Mathematics.dll
Syntax
public struct Matrix3x3 : IEquatable<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. |
float | m12 | The M12. |
float | m13 | The M13. |
float | m21 | The M21. |
float | m22 | The M22. |
float | m23 | The M23. |
float | m31 | The M31. |
float | m32 | The M32. |
float | m33 | The M33. |
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 the 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
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 matrix1. |
Matrix3x3 | matrix2 | The matrix2. |
Matrix3x3 | result | The result. |
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 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
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
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
CreateScale(float, float)
Creates the scale.
Declaration
public static Matrix3x3 CreateScale(float xScale, float yScale)
Parameters
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 transform 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
CreateTranslation(float, float)
Creates the translation.
Declaration
public static Matrix3x3 CreateTranslation(float xPosition, float yPosition)
Parameters
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()
Determinants this instance.
Declaration
public float Determinant()
Returns
Type | Description |
---|---|
float | The result. |
Equals(Matrix3x3)
Equalses the specified other.
Declaration
public bool Equals(Matrix3x3 other)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | other | The other. |
Returns
Type | Description |
---|---|
bool | The result. |
Equals(ref Matrix3x3)
Equalses the specified other.
Declaration
public bool Equals(ref Matrix3x3 other)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | other | The other. |
Returns
Type | Description |
---|---|
bool | The result. |
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Returns
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
Returns
Type | Description |
---|---|
bool | True if everything 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 matrix1. |
Matrix3x3 | matrix2 | The matrix2. |
float | amount | The 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 matrix1. |
Matrix3x3 | matrix2 | The matrix2. |
float | amount | The amount. |
Matrix3x3 | result | The result. |
Multiply(Matrix3x3, Matrix3x3)
Multiplies the specified matrix1.
Declaration
public static Matrix3x3 Multiply(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Multiply(Matrix3x3, float)
Multiplies the specified matrix1.
Declaration
public static Matrix3x3 Multiply(Matrix3x3 matrix1, float scaleFactor)
Parameters
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Multiply(ref Matrix3x3, ref Matrix3x3, out Matrix3x3)
Multiplies the specified matrix1.
Declaration
public static void Multiply(ref Matrix3x3 matrix1, ref Matrix3x3 matrix2, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The matrix1. |
Matrix3x3 | matrix2 | The matrix2. |
Matrix3x3 | result | The result. |
Multiply(ref Matrix3x3, float, out Matrix3x3)
Multiplies the specified matrix1.
Declaration
public static void Multiply(ref Matrix3x3 matrix, float scaleFactor, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix | The matrix1. |
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
SetSameDiagonal(float)
Set 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
Returns
Type | Description |
---|---|
Matrix3x3 | The result. |
Subtract(ref Matrix3x3, ref Matrix3x3, out Matrix3x3)
Subtracts the specified matrix1.
Declaration
public static void Subtract(ref Matrix3x3 matrix1, ref Matrix3x3 matrix2, out Matrix3x3 result)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | matrix1 | The matrix1. |
Matrix3x3 | matrix2 | The matrix2. |
Matrix3x3 | result | The result. |
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
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
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
Operators
operator +(Matrix3x3, Matrix3x3)
Implements the operator +.
Declaration
public static Matrix3x3 operator +(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operator. |
operator /(Matrix3x3, Matrix3x3)
Implements the operator /.
Declaration
public static Matrix3x3 operator /(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
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
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operator. |
operator ==(Matrix3x3, Matrix3x3)
Implements the operator ==.
Declaration
public static bool operator ==(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
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
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
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operator. |
operator *(Matrix3x3, float)
Implements the operator *.
Declaration
public static Matrix3x3 operator *(Matrix3x3 matrix, float scaleFactor)
Parameters
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operator. |
operator *(float, Matrix3x3)
Implements the operator *.
Declaration
public static Matrix3x3 operator *(float scaleFactor, Matrix3x3 matrix)
Parameters
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operator. |
operator -(Matrix3x3, Matrix3x3)
Implements the operator -.
Declaration
public static Matrix3x3 operator -(Matrix3x3 matrix1, Matrix3x3 matrix2)
Parameters
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 matrix1. |
Returns
Type | Description |
---|---|
Matrix3x3 | The result of the operator. |