Class Matrix3x3
Represents a 3x3 mathematical matrix.
Inheritance
Implements
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public sealed class Matrix3x3 : ValueType, IEquatable<Matrix3x3>, IFormattable
Constructors
Matrix3x3(Matrix)
Initializes a new instance of the Matrix3x3 struct.
Declaration
public Matrix3x3(Matrix m)
Parameters
Matrix
m
The rotation/scale matrix. |
Matrix3x3(Single)
Initializes a new instance of the Matrix3x3 struct.
Declaration
public Matrix3x3(float value)
Parameters
System.Single
value
The value that will be assigned to all components. |
Matrix3x3(Single, Single, Single, Single, Single, Single, Single, Single, Single)
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
System.Single
m11
The value to assign at row 1 column 1 of the Matrix3x3. |
System.Single
m12
The value to assign at row 1 column 2 of the Matrix3x3. |
System.Single
m13
The value to assign at row 1 column 3 of the Matrix3x3. |
System.Single
m21
The value to assign at row 2 column 1 of the Matrix3x3. |
System.Single
m22
The value to assign at row 2 column 2 of the Matrix3x3. |
System.Single
m23
The value to assign at row 2 column 3 of the Matrix3x3. |
System.Single
m31
The value to assign at row 3 column 1 of the Matrix3x3. |
System.Single
m32
The value to assign at row 3 column 2 of the Matrix3x3. |
System.Single
m33
The value to assign at row 3 column 3 of the Matrix3x3. |
Matrix3x3(Single[])
Initializes a new instance of the Matrix3x3 struct.
Declaration
public Matrix3x3(float[] values)
Parameters
System.Single[]
values
The values to assign to the components of the Matrix3x3. This must be an array with nine elements. |
Exceptions
System.ArgumentNullException
Thrown when |
System.ArgumentOutOfRangeException
Thrown when |
Fields
Identity
M11
Value at row 1 column 1 of the Matrix3x3.
Declaration
public float M11
Field Value
System.Single
|
M12
Value at row 1 column 2 of the Matrix3x3.
Declaration
public float M12
Field Value
System.Single
|
M13
Value at row 1 column 3 of the Matrix3x3.
Declaration
public float M13
Field Value
System.Single
|
M21
Value at row 2 column 1 of the Matrix3x3.
Declaration
public float M21
Field Value
System.Single
|
M22
Value at row 2 column 2 of the Matrix3x3.
Declaration
public float M22
Field Value
System.Single
|
M23
Value at row 2 column 3 of the Matrix3x3.
Declaration
public float M23
Field Value
System.Single
|
M31
Value at row 3 column 1 of the Matrix3x3.
Declaration
public float M31
Field Value
System.Single
|
M32
Value at row 3 column 2 of the Matrix3x3.
Declaration
public float M32
Field Value
System.Single
|
M33
Value at row 3 column 3 of the Matrix3x3.
Declaration
public float M33
Field Value
System.Single
|
SizeInBytes
The size of the Matrix3x3 type, in bytes.
Declaration
public static readonly int SizeInBytes
Field Value
System.Int32
|
Zero
A Matrix3x3 with all of its components set to zero.
Declaration
public static readonly Matrix3x3 Zero
Field Value
Matrix3x3
|
Properties
Column1
Gets or sets the first column in the Matrix3x3; that is M11, M21, M31
Declaration
public Float3 Column1 { get; set; }
Property Value
Float3
|
Column2
Gets or sets the second column in the Matrix3x3; that is M12, M22, M32
Declaration
public Float3 Column2 { get; set; }
Property Value
Float3
|
Column3
Gets or sets the third column in the Matrix3x3; that is M13, M23, M33
Declaration
public Float3 Column3 { get; set; }
Property Value
Float3
|
Default
The default Matrix3x3.
Declaration
public static Matrix3x3 Default { get; }
Property Value
Matrix3x3
|
IsIdentity
Gets a value indicating whether this instance is an identity Matrix3x3.
Declaration
public bool IsIdentity { get; }
Property Value
System.Boolean
|
Item[Int32]
Gets or sets the component at the specified index.
Declaration
public float this[int index] { get; set; }
Parameters
System.Int32
index
The zero-based index of the component to access. |
Property Value
System.Single
The value of the Matrix3x3 component, depending on the index. |
Exceptions
System.ArgumentOutOfRangeException
Thrown when the |
Item[Int32, Int32]
Gets or sets the component at the specified index.
Declaration
public float this[int row, int column] { get; set; }
Parameters
System.Int32
row
The row of the Matrix3x3 to access. |
System.Int32
column
The column of the Matrix3x3 to access. |
Property Value
System.Single
The value of the Matrix3x3 component, depending on the index. |
Exceptions
System.ArgumentOutOfRangeException
Thrown when the |
Row1
Gets or sets the first row in the Matrix3x3; that is M11, M12, M13
Declaration
public Float3 Row1 { get; set; }
Property Value
Float3
|
Row2
Gets or sets the second row in the Matrix3x3; that is M21, M22, M23
Declaration
public Float3 Row2 { get; set; }
Property Value
Float3
|
Row3
Gets or sets the third row in the Matrix3x3; that is M31, M32, M33
Declaration
public Float3 Row3 { get; set; }
Property Value
Float3
|
ScaleVector
Gets or sets the scale of the Matrix3x3; that is M11, M22, and M33.
Declaration
public Float3 ScaleVector { get; set; }
Property Value
Float3
|
Methods
Add(Matrix3x3, Matrix3x3)
Determines the sum of two matrices.
Declaration
public static Matrix3x3 Add(Matrix3x3 left, Matrix3x3 right)
Parameters
Matrix3x3
left
The first Matrix3x3 to add. |
Matrix3x3
right
The second Matrix3x3 to add. |
Returns
Matrix3x3
The sum of the two matrices. |
Add(ref Matrix3x3, ref Matrix3x3, out Matrix3x3)
Determines the sum of two matrices.
Declaration
public static void Add(ref Matrix3x3 left, ref Matrix3x3 right, out Matrix3x3 result)
Parameters
Matrix3x3
left
The first Matrix3x3 to add. |
Matrix3x3
right
The second Matrix3x3 to add. |
Matrix3x3
result
When the method completes, contains the sum of the two matrices. |
Billboard(Float3, Float3, Float3, Float3)
Creates a left-handed spherical billboard that rotates around a specified object position.
Declaration
public static Matrix3x3 Billboard(Float3 objectPosition, Float3 cameraPosition, Float3 cameraUpFloat, Float3 cameraForwardFloat)
Parameters
Float3
objectPosition
The position of the object around which the billboard will rotate. |
Float3
cameraPosition
The position of the camera. |
Float3
cameraUpFloat
The up vector of the camera. |
Float3
cameraForwardFloat
The forward vector of the camera. |
Returns
Matrix3x3
The created billboard Matrix3x3. |
Billboard(ref Float3, ref Float3, ref Float3, ref Float3, out Matrix3x3)
Creates a left-handed spherical billboard that rotates around a specified object position.
Declaration
public static void Billboard(ref Float3 objectPosition, ref Float3 cameraPosition, ref Float3 cameraUpFloat, ref Float3 cameraForwardFloat, out Matrix3x3 result)
Parameters
Float3
objectPosition
The position of the object around which the billboard will rotate. |
Float3
cameraPosition
The position of the camera. |
Float3
cameraUpFloat
The up vector of the camera. |
Float3
cameraForwardFloat
The forward vector of the camera. |
Matrix3x3
result
When the method completes, contains the created billboard Matrix3x3. |
Decompose(out Float3, out Quaternion)
Decomposes a Matrix3x3 into a scale, rotation, and translation.
Declaration
public bool Decompose(out Float3 scale, out Quaternion rotation)
Parameters
Float3
scale
When the method completes, contains the scaling component of the decomposed Matrix3x3. |
Quaternion
rotation
When the method completes, contains the rotation component of the decomposed Matrix3x3. |
Returns
System.Boolean
|
Remarks
This method is designed to decompose an SRT transformation Matrix3x3 only.
DecomposeLQ(out Matrix3x3, out Matrix3x3)
Decomposes a Matrix3x3 into a lower triangular Matrix3x3 l and an orthonormalized Matrix3x3 q.
Declaration
public void DecomposeLQ(out Matrix3x3 l, out Matrix3x3 q)
Parameters
Matrix3x3
l
When the method completes, contains the lower triangular Matrix3x3 of the decomposition. |
Matrix3x3
q
When the method completes, contains the orthonormalized Matrix3x3 of the decomposition. |
DecomposeQR(out Matrix3x3, out Matrix3x3)
Decomposes a Matrix3x3 into an orthonormalized Matrix3x3 q and a right triangular Matrix3x3 r.
Declaration
public void DecomposeQR(out Matrix3x3 q, out Matrix3x3 r)
Parameters
Matrix3x3
q
When the method completes, contains the orthonormalized Matrix3x3 of the decomposition. |
Matrix3x3
r
When the method completes, contains the right triangular Matrix3x3 of the decomposition. |
DecomposeUniformScale(out Single, out Quaternion)
Decomposes a uniform scale matrix into a scale, rotation, and translation. A uniform scale matrix has the same scale in every axis.
Declaration
public bool DecomposeUniformScale(out float scale, out Quaternion rotation)
Parameters
System.Single
scale
When the method completes, contains the scaling component of the decomposed matrix. |
Quaternion
rotation
When the method completes, contains the rotation component of the decomposed matrix. |
Returns
System.Boolean
|
Remarks
This method is designed to decompose only an SRT transformation matrix that has the same scale in every axis.
Determinant()
Calculates the determinant of the Matrix3x3.
Declaration
public float Determinant()
Returns
System.Single
The determinant of the Matrix3x3. |
Divide(Matrix3x3, Matrix3x3)
Determines the quotient of two matrices.
Declaration
public static Matrix3x3 Divide(Matrix3x3 left, Matrix3x3 right)
Parameters
Matrix3x3
left
The first Matrix3x3 to divide. |
Matrix3x3
right
The second Matrix3x3 to divide. |
Returns
Matrix3x3
The quotient of the two matrices. |
Divide(Matrix3x3, Single)
Scales a Matrix3x3 by the given value.
Declaration
public static Matrix3x3 Divide(Matrix3x3 left, float right)
Parameters
Matrix3x3
left
The Matrix3x3 to scale. |
System.Single
right
The amount by which to scale. |
Returns
Matrix3x3
The scaled Matrix3x3. |
Divide(ref Matrix3x3, ref Matrix3x3, out Matrix3x3)
Determines the quotient of two matrices.
Declaration
public static void Divide(ref Matrix3x3 left, ref Matrix3x3 right, out Matrix3x3 result)
Parameters
Matrix3x3
left
The first Matrix3x3 to divide. |
Matrix3x3
right
The second Matrix3x3 to divide. |
Matrix3x3
result
When the method completes, contains the quotient of the two matrices. |
Divide(ref Matrix3x3, Single, out Matrix3x3)
Scales a Matrix3x3 by the given value.
Declaration
public static void Divide(ref Matrix3x3 left, float right, out Matrix3x3 result)
Parameters
Matrix3x3
left
The Matrix3x3 to scale. |
System.Single
right
The amount by which to scale. |
Matrix3x3
result
When the method completes, contains the scaled Matrix3x3. |
Equals(Matrix3x3)
Determines whether the specified Matrix3x3 is equal to this instance.
Declaration
public bool Equals(Matrix3x3 other)
Parameters
Matrix3x3
other
The Matrix3x3 to compare with this instance. |
Returns
System.Boolean
|
Equals(ref Matrix3x3)
Determines whether the specified Matrix3x3 is equal to this instance.
Declaration
public bool Equals(ref Matrix3x3 other)
Parameters
Matrix3x3
other
The Matrix3x3 to compare with this instance. |
Returns
System.Boolean
|
Equals(ref Matrix3x3, ref Matrix3x3)
Determines whether the specified Matrix3x3 are equal.
Declaration
public static bool Equals(ref Matrix3x3 a, ref Matrix3x3 b)
Parameters
Matrix3x3
a
|
Matrix3x3
b
|
Returns
System.Boolean
|
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object value)
Parameters
System.Object
value
The System.Object to compare with this instance. |
Returns
System.Boolean
|
ExchangeColumns(Int32, Int32)
Exchanges two columns in the Matrix3x3.
Declaration
public void ExchangeColumns(int firstColumn, int secondColumn)
Parameters
System.Int32
firstColumn
The first column to exchange. This is an index of the column starting at zero. |
System.Int32
secondColumn
The second column to exchange. This is an index of the column starting at zero. |
ExchangeRows(Int32, Int32)
Exchanges two rows in the Matrix3x3.
Declaration
public void ExchangeRows(int firstRow, int secondRow)
Parameters
System.Int32
firstRow
The first row to exchange. This is an index of the row starting at zero. |
System.Int32
secondRow
The second row to exchange. This is an index of the row starting at zero. |
Exponent(Matrix3x3, Int32)
Performs the exponential operation on a Matrix3x3.
Declaration
public static Matrix3x3 Exponent(Matrix3x3 value, int exponent)
Parameters
Matrix3x3
value
The Matrix3x3 to perform the operation on. |
System.Int32
exponent
The exponent to raise the Matrix3x3 to. |
Returns
Matrix3x3
The exponential Matrix3x3. |
Exceptions
System.ArgumentOutOfRangeException
Thrown when the |
Exponent(ref Matrix3x3, Int32, out Matrix3x3)
Performs the exponential operation on a Matrix3x3.
Declaration
public static void Exponent(ref Matrix3x3 value, int exponent, out Matrix3x3 result)
Parameters
Matrix3x3
value
The Matrix3x3 to perform the operation on. |
System.Int32
exponent
The exponent to raise the Matrix3x3 to. |
Matrix3x3
result
When the method completes, contains the exponential Matrix3x3. |
Exceptions
System.ArgumentOutOfRangeException
Thrown when the |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System.Int32
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Invert()
Inverts the Matrix3x3.
Declaration
public void Invert()
Invert(Matrix3x3)
Calculates the inverse of the specified Matrix3x3.
Declaration
public static Matrix3x3 Invert(Matrix3x3 value)
Parameters
Matrix3x3
value
The Matrix3x3 whose inverse is to be calculated. |
Returns
Matrix3x3
The inverse of the specified Matrix3x3. |
Invert(ref Matrix3x3, out Matrix3x3)
Calculates the inverse of the specified Matrix3x3.
Declaration
public static void Invert(ref Matrix3x3 value, out Matrix3x3 result)
Parameters
Matrix3x3
value
The Matrix3x3 whose inverse is to be calculated. |
Matrix3x3
result
When the method completes, contains the inverse of the specified Matrix3x3. |
Lerp(Matrix3x3, Matrix3x3, Single)
Performs a linear interpolation between two matrices.
Declaration
public static Matrix3x3 Lerp(Matrix3x3 start, Matrix3x3 end, float amount)
Parameters
Matrix3x3
start
Start Matrix3x3. |
Matrix3x3
end
End Matrix3x3. |
System.Single
amount
Value between 0 and 1 indicating the weight of |
Returns
Matrix3x3
The linear interpolation of the two matrices. |
Remarks
Passing amount
a value of 0 will cause start
to be returned; a value of 1 will cause end
to be returned.
Lerp(ref Matrix3x3, ref Matrix3x3, Single, out Matrix3x3)
Performs a linear interpolation between two matrices.
Declaration
public static void Lerp(ref Matrix3x3 start, ref Matrix3x3 end, float amount, out Matrix3x3 result)
Parameters
Matrix3x3
start
Start Matrix3x3. |
Matrix3x3
end
End Matrix3x3. |
System.Single
amount
Value between 0 and 1 indicating the weight of |
Matrix3x3
result
When the method completes, contains the linear interpolation of the two matrices. |
Remarks
Passing amount
a value of 0 will cause start
to be returned; a value of 1 will cause end
to be returned.
LookAt(Float3, Float3, Float3)
Creates a left-handed, look-at Matrix3x3.
Declaration
public static Matrix3x3 LookAt(Float3 eye, Float3 target, Float3 up)
Parameters
Float3
eye
The position of the viewer's eye. |
Float3
target
The camera look-at target. |
Float3
up
The camera's up vector. |
Returns
Matrix3x3
The created look-at Matrix3x3. |
LookAt(ref Float3, ref Float3, ref Float3, out Matrix3x3)
Creates a left-handed, look-at Matrix3x3.
Declaration
public static void LookAt(ref Float3 eye, ref Float3 target, ref Float3 up, out Matrix3x3 result)
Parameters
Float3
eye
The position of the viewer's eye. |
Float3
target
The camera look-at target. |
Float3
up
The camera's up vector. |
Matrix3x3
result
When the method completes, contains the created look-at Matrix3x3. |
LowerTriangularForm(Matrix3x3)
Brings the Matrix3x3 into lower triangular form using elementary row operations.
Declaration
public static Matrix3x3 LowerTriangularForm(Matrix3x3 value)
Parameters
Matrix3x3
value
The Matrix3x3 to put into lower triangular form. |
Returns
Matrix3x3
The lower triangular Matrix3x3. |
Remarks
If the Matrix3x3 is not invertible (i.e. its determinant is zero) than the result of this method may produce Single.Nan and Single.Inf values. When the Matrix3x3 represents a system of linear equations, than this often means that either no solution exists or an infinite number of solutions exist.
LowerTriangularForm(ref Matrix3x3, out Matrix3x3)
Brings the Matrix3x3 into lower triangular form using elementary row operations.
Declaration
public static void LowerTriangularForm(ref Matrix3x3 value, out Matrix3x3 result)
Parameters
Matrix3x3
value
The Matrix3x3 to put into lower triangular form. |
Matrix3x3
result
When the method completes, contains the lower triangular Matrix3x3. |
Remarks
If the Matrix3x3 is not invertible (i.e. its determinant is zero) than the result of this method may produce Single.Nan and Single.Inf values. When the Matrix3x3 represents a system of linear equations, than this often means that either no solution exists or an infinite number of solutions exist.
Multiply(Matrix3x3, Matrix3x3)
Determines the product of two matrices.
Declaration
public static Matrix3x3 Multiply(Matrix3x3 left, Matrix3x3 right)
Parameters
Matrix3x3
left
The first Matrix3x3 to multiply. |
Matrix3x3
right
The second Matrix3x3 to multiply. |
Returns
Matrix3x3
The product of the two matrices. |
Multiply(Matrix3x3, Single)
Scales a Matrix3x3 by the given value.
Declaration
public static Matrix3x3 Multiply(Matrix3x3 left, float right)
Parameters
Matrix3x3
left
The Matrix3x3 to scale. |
System.Single
right
The amount by which to scale. |
Returns
Matrix3x3
The scaled Matrix3x3. |
Multiply(ref Matrix3x3, ref Matrix3x3, out Matrix3x3)
Determines the product of two matrices.
Declaration
public static void Multiply(ref Matrix3x3 left, ref Matrix3x3 right, out Matrix3x3 result)
Parameters
Matrix3x3
left
The first Matrix3x3 to multiply. |
Matrix3x3
right
The second Matrix3x3 to multiply. |
Matrix3x3
result
The product of the two matrices. |
Multiply(ref Matrix3x3, Single, out Matrix3x3)
Scales a Matrix3x3 by the given value.
Declaration
public static void Multiply(ref Matrix3x3 left, float right, out Matrix3x3 result)
Parameters
Matrix3x3
left
The Matrix3x3 to scale. |
System.Single
right
The amount by which to scale. |
Matrix3x3
result
When the method completes, contains the scaled Matrix3x3. |
Negate(Matrix3x3)
Negates a Matrix3x3.
Declaration
public static Matrix3x3 Negate(Matrix3x3 value)
Parameters
Matrix3x3
value
The Matrix3x3 to be negated. |
Returns
Matrix3x3
The negated Matrix3x3. |
Negate(ref Matrix3x3, out Matrix3x3)
Negates a Matrix3x3.
Declaration
public static void Negate(ref Matrix3x3 value, out Matrix3x3 result)
Parameters
Matrix3x3
value
The Matrix3x3 to be negated. |
Matrix3x3
result
When the method completes, contains the negated Matrix3x3. |
Orthogonalize()
Orthogonalizes the specified Matrix3x3.
Declaration
public void Orthogonalize()
Remarks
Orthogonalization is the process of making all rows orthogonal to each other. This means that any given row in the Matrix3x3 will be orthogonal to any other given row in the Matrix3x3.
Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 tends to be numerically unstable. The numeric stability decreases according to the rows so that the first row is the most stable and the last row is the least stable.
This operation is performed on the rows of the Matrix3x3 rather than the columns. If you wish for this operation to be performed on the columns, first transpose the input and than transpose the output.
Orthogonalize(Matrix3x3)
Orthogonalizes the specified Matrix3x3.
Declaration
public static Matrix3x3 Orthogonalize(Matrix3x3 value)
Parameters
Matrix3x3
value
The Matrix3x3 to orthogonalize. |
Returns
Matrix3x3
The orthogonalized Matrix3x3. |
Remarks
Orthogonalization is the process of making all rows orthogonal to each other. This means that any given row in the Matrix3x3 will be orthogonal to any other given row in the Matrix3x3.
Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 tends to be numerically unstable. The numeric stability decreases according to the rows so that the first row is the most stable and the last row is the least stable.
This operation is performed on the rows of the Matrix3x3 rather than the columns. If you wish for this operation to be performed on the columns, first transpose the input and than transpose the output.
Orthogonalize(ref Matrix3x3, out Matrix3x3)
Orthogonalizes the specified Matrix3x3.
Declaration
public static void Orthogonalize(ref Matrix3x3 value, out Matrix3x3 result)
Parameters
Matrix3x3
value
The Matrix3x3 to orthogonalize. |
Matrix3x3
result
When the method completes, contains the orthogonalized Matrix3x3. |
Remarks
Orthogonalization is the process of making all rows orthogonal to each other. This means that any given row in the Matrix3x3 will be orthogonal to any other given row in the Matrix3x3.
Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 tends to be numerically unstable. The numeric stability decreases according to the rows so that the first row is the most stable and the last row is the least stable.
This operation is performed on the rows of the Matrix3x3 rather than the columns. If you wish for this operation to be performed on the columns, first transpose the input and than transpose the output.
Orthonormalize()
Orthonormalizes the specified Matrix3x3.
Declaration
public void Orthonormalize()
Remarks
Orthonormalization is the process of making all rows and columns orthogonal to each other and making all rows and columns of unit length. This means that any given row will be orthogonal to any other given row and any given column will be orthogonal to any other given column. Any given row will not be orthogonal to any given column. Every row and every column will be of unit length.
Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 tends to be numerically unstable. The numeric stability decreases according to the rows so that the first row is the most stable and the last row is the least stable.
This operation is performed on the rows of the Matrix3x3 rather than the columns. If you wish for this operation to be performed on the columns, first transpose the input and than transpose the output.
Orthonormalize(Matrix3x3)
Orthonormalizes the specified Matrix3x3.
Declaration
public static Matrix3x3 Orthonormalize(Matrix3x3 value)
Parameters
Matrix3x3
value
The Matrix3x3 to orthonormalize. |
Returns
Matrix3x3
The orthonormalized Matrix3x3. |
Remarks
Orthonormalization is the process of making all rows and columns orthogonal to each other and making all rows and columns of unit length. This means that any given row will be orthogonal to any other given row and any given column will be orthogonal to any other given column. Any given row will not be orthogonal to any given column. Every row and every column will be of unit length.
Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 tends to be numerically unstable. The numeric stability decreases according to the rows so that the first row is the most stable and the last row is the least stable.
This operation is performed on the rows of the Matrix3x3 rather than the columns. If you wish for this operation to be performed on the columns, first transpose the input and than transpose the output.
Orthonormalize(ref Matrix3x3, out Matrix3x3)
Orthonormalizes the specified Matrix3x3.
Declaration
public static void Orthonormalize(ref Matrix3x3 value, out Matrix3x3 result)
Parameters
Matrix3x3
value
The Matrix3x3 to orthonormalize. |
Matrix3x3
result
When the method completes, contains the orthonormalized Matrix3x3. |
Remarks
Orthonormalization is the process of making all rows and columns orthogonal to each other and making all rows and columns of unit length. This means that any given row will be orthogonal to any other given row and any given column will be orthogonal to any other given column. Any given row will not be orthogonal to any given column. Every row and every column will be of unit length.
Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 tends to be numerically unstable. The numeric stability decreases according to the rows so that the first row is the most stable and the last row is the least stable.
This operation is performed on the rows of the Matrix3x3 rather than the columns. If you wish for this operation to be performed on the columns, first transpose the input and than transpose the output.
RotationAxis(Float3, Single)
Creates a Matrix3x3 that rotates around an arbitrary axis.
Declaration
public static Matrix3x3 RotationAxis(Float3 axis, float angle)
Parameters
Float3
axis
The axis around which to rotate. This parameter is assumed to be normalized. |
System.Single
angle
Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
Returns
Matrix3x3
The created rotation Matrix3x3. |
RotationAxis(ref Float3, Single, out Matrix3x3)
Creates a Matrix3x3 that rotates around an arbitrary axis.
Declaration
public static void RotationAxis(ref Float3 axis, float angle, out Matrix3x3 result)
Parameters
Float3
axis
The axis around which to rotate. This parameter is assumed to be normalized. |
System.Single
angle
Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
Matrix3x3
result
When the method completes, contains the created rotation Matrix3x3. |
RotationQuaternion(Quaternion)
Creates a rotation Matrix3x3 from a quaternion.
Declaration
public static Matrix3x3 RotationQuaternion(Quaternion rotation)
Parameters
Quaternion
rotation
The quaternion to use to build the Matrix3x3. |
Returns
Matrix3x3
The created rotation Matrix3x3. |
RotationQuaternion(ref Quaternion, out Matrix3x3)
Creates a rotation Matrix3x3 from a quaternion.
Declaration
public static void RotationQuaternion(ref Quaternion rotation, out Matrix3x3 result)
Parameters
Quaternion
rotation
The quaternion to use to build the Matrix3x3. |
Matrix3x3
result
The created rotation Matrix3x3. |
RotationX(Single)
Creates a Matrix3x3 that rotates around the x-axis.
Declaration
public static Matrix3x3 RotationX(float angle)
Parameters
System.Single
angle
Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
Returns
Matrix3x3
The created rotation Matrix3x3. |
RotationX(Single, out Matrix3x3)
Creates a Matrix3x3 that rotates around the x-axis.
Declaration
public static void RotationX(float angle, out Matrix3x3 result)
Parameters
System.Single
angle
Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
Matrix3x3
result
When the method completes, contains the created rotation Matrix3x3. |
RotationY(Single)
Creates a Matrix3x3 that rotates around the y-axis.
Declaration
public static Matrix3x3 RotationY(float angle)
Parameters
System.Single
angle
Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
Returns
Matrix3x3
The created rotation Matrix3x3. |
RotationY(Single, out Matrix3x3)
Creates a Matrix3x3 that rotates around the y-axis.
Declaration
public static void RotationY(float angle, out Matrix3x3 result)
Parameters
System.Single
angle
Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
Matrix3x3
result
When the method completes, contains the created rotation Matrix3x3. |
RotationYawPitchRoll(Single, Single, Single)
Creates a rotation Matrix3x3 with a specified yaw, pitch, and roll.
Declaration
public static Matrix3x3 RotationYawPitchRoll(float yaw, float pitch, float roll)
Parameters
System.Single
yaw
Yaw around the y-axis, in radians. |
System.Single
pitch
Pitch around the x-axis, in radians. |
System.Single
roll
Roll around the z-axis, in radians. |
Returns
Matrix3x3
The created rotation Matrix3x3. |
RotationYawPitchRoll(Single, Single, Single, out Matrix3x3)
Creates a rotation Matrix3x3 with a specified yaw, pitch, and roll.
Declaration
public static void RotationYawPitchRoll(float yaw, float pitch, float roll, out Matrix3x3 result)
Parameters
System.Single
yaw
Yaw around the y-axis, in radians. |
System.Single
pitch
Pitch around the x-axis, in radians. |
System.Single
roll
Roll around the z-axis, in radians. |
Matrix3x3
result
When the method completes, contains the created rotation Matrix3x3. |
RotationZ(Single)
Creates a Matrix3x3 that rotates around the z-axis.
Declaration
public static Matrix3x3 RotationZ(float angle)
Parameters
System.Single
angle
Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
Returns
Matrix3x3
The created rotation Matrix3x3. |
RotationZ(Single, out Matrix3x3)
Creates a Matrix3x3 that rotates around the z-axis.
Declaration
public static void RotationZ(float angle, out Matrix3x3 result)
Parameters
System.Single
angle
Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. |
Matrix3x3
result
When the method completes, contains the created rotation Matrix3x3. |
RowEchelonForm(Matrix3x3)
Brings the Matrix3x3 into row echelon form using elementary row operations;
Declaration
public static Matrix3x3 RowEchelonForm(Matrix3x3 value)
Parameters
Matrix3x3
value
The Matrix3x3 to put into row echelon form. |
Returns
Matrix3x3
When the method completes, contains the row echelon form of the Matrix3x3. |
RowEchelonForm(ref Matrix3x3, out Matrix3x3)
Brings the Matrix3x3 into row echelon form using elementary row operations;
Declaration
public static void RowEchelonForm(ref Matrix3x3 value, out Matrix3x3 result)
Parameters
Matrix3x3
value
The Matrix3x3 to put into row echelon form. |
Matrix3x3
result
When the method completes, contains the row echelon form of the Matrix3x3. |
Scaling(Float3)
Creates a Matrix3x3 that scales along the x-axis, y-axis, and z-axis.
Declaration
public static Matrix3x3 Scaling(Float3 scale)
Parameters
Float3
scale
Scaling factor for all three axes. |
Returns
Matrix3x3
The created scaling Matrix3x3. |
Scaling(ref Float3, out Matrix3x3)
Creates a Matrix3x3 that scales along the x-axis, y-axis, and y-axis.
Declaration
public static void Scaling(ref Float3 scale, out Matrix3x3 result)
Parameters
Float3
scale
Scaling factor for all three axes. |
Matrix3x3
result
When the method completes, contains the created scaling Matrix3x3. |
Scaling(Single)
Creates a Matrix3x3 that uniformly scales along all three axes.
Declaration
public static Matrix3x3 Scaling(float scale)
Parameters
System.Single
scale
The uniform scale that is applied along all axes. |
Returns
Matrix3x3
The created scaling Matrix3x3. |
Scaling(Single, out Matrix3x3)
Creates a Matrix3x3 that uniformly scales along all three axes.
Declaration
public static void Scaling(float scale, out Matrix3x3 result)
Parameters
System.Single
scale
The uniform scale that is applied along all axes. |
Matrix3x3
result
When the method completes, contains the created scaling Matrix3x3. |
Scaling(Single, Single, Single)
Creates a Matrix3x3 that scales along the x-axis, y-axis, and y-axis.
Declaration
public static Matrix3x3 Scaling(float x, float y, float z)
Parameters
System.Single
x
Scaling factor that is applied along the x-axis. |
System.Single
y
Scaling factor that is applied along the y-axis. |
System.Single
z
Scaling factor that is applied along the z-axis. |
Returns
Matrix3x3
The created scaling Matrix3x3. |
Scaling(Single, Single, Single, out Matrix3x3)
Creates a Matrix3x3 that scales along the x-axis, y-axis, and z-axis.
Declaration
public static void Scaling(float x, float y, float z, out Matrix3x3 result)
Parameters
System.Single
x
Scaling factor that is applied along the x-axis. |
System.Single
y
Scaling factor that is applied along the y-axis. |
System.Single
z
Scaling factor that is applied along the z-axis. |
Matrix3x3
result
When the method completes, contains the created scaling Matrix3x3. |
Shear(ref Float2, out Matrix3x3)
Creates the 2D shear matrix. Represented by: [1 Y 0] [X 1 0] [0 0 1]
Declaration
public static void Shear(ref Float2 shearAngles, out Matrix3x3 result)
Parameters
Float2
shearAngles
The shear angles (in degrees). |
Matrix3x3
result
The result. |
SmoothStep(Matrix3x3, Matrix3x3, Single)
Performs a cubic interpolation between two matrices.
Declaration
public static Matrix3x3 SmoothStep(Matrix3x3 start, Matrix3x3 end, float amount)
Parameters
Matrix3x3
start
Start Matrix3x3. |
Matrix3x3
end
End Matrix3x3. |
System.Single
amount
Value between 0 and 1 indicating the weight of |
Returns
Matrix3x3
The cubic interpolation of the two matrices. |
SmoothStep(ref Matrix3x3, ref Matrix3x3, Single, out Matrix3x3)
Performs a cubic interpolation between two matrices.
Declaration
public static void SmoothStep(ref Matrix3x3 start, ref Matrix3x3 end, float amount, out Matrix3x3 result)
Parameters
Matrix3x3
start
Start Matrix3x3. |
Matrix3x3
end
End Matrix3x3. |
System.Single
amount
Value between 0 and 1 indicating the weight of |
Matrix3x3
result
When the method completes, contains the cubic interpolation of the two matrices. |
Subtract(Matrix3x3, Matrix3x3)
Determines the difference between two matrices.
Declaration
public static Matrix3x3 Subtract(Matrix3x3 left, Matrix3x3 right)
Parameters
Matrix3x3
left
The first Matrix3x3 to subtract. |
Matrix3x3
right
The second Matrix3x3 to subtract. |
Returns
Matrix3x3
The difference between the two matrices. |
Subtract(ref Matrix3x3, ref Matrix3x3, out Matrix3x3)
Determines the difference between two matrices.
Declaration
public static void Subtract(ref Matrix3x3 left, ref Matrix3x3 right, out Matrix3x3 result)
Parameters
Matrix3x3
left
The first Matrix3x3 to subtract. |
Matrix3x3
right
The second Matrix3x3 to subtract. |
Matrix3x3
result
When the method completes, contains the difference between the two matrices. |
ToArray()
Creates an array containing the elements of the Matrix3x3.
Declaration
public float[] ToArray()
Returns
System.Single[]
A 9-element array containing the components of the Matrix3x3. |
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
System.String
A System.String that represents this instance. |
ToString(IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
System.IFormatProvider
formatProvider
The format provider. |
Returns
System.String
A System.String that represents this instance. |
ToString(String)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format)
Parameters
System.String
format
The format. |
Returns
System.String
A System.String that represents this instance. |
ToString(String, IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
System.String
format
The format. |
System.IFormatProvider
formatProvider
The format provider. |
Returns
System.String
A System.String that represents this instance. |
Transform2D(Float2, Matrix3x3)
Transforms given vector by the matrix (in 2D).
Declaration
public static Float2 Transform2D(Float2 vector, Matrix3x3 transform)
Parameters
Float2
vector
The vector. |
Matrix3x3
transform
The transform. |
Returns
Float2
The result. |
Transform2D(ref Float2, ref Matrix3x3, out Float2)
Transforms given vector by the matrix (in 2D).
Declaration
public static void Transform2D(ref Float2 vector, ref Matrix3x3 transform, out Float2 result)
Parameters
Float2
vector
The vector. |
Matrix3x3
transform
The transform. |
Float2
result
The result. |
Translation2D(Float2)
Creates 2D translation matrix.
Declaration
public static Matrix3x3 Translation2D(Float2 translation)
Parameters
Float2
translation
The translation vector. |
Returns
Matrix3x3
The result. |
Translation2D(ref Float2, out Matrix3x3)
Creates 2D translation matrix.
Declaration
public static void Translation2D(ref Float2 translation, out Matrix3x3 result)
Parameters
Float2
translation
The translation vector. |
Matrix3x3
result
The result. |
Translation2D(Single, Single)
Creates 2D translation matrix.
Declaration
public static Matrix3x3 Translation2D(float x, float y)
Parameters
System.Single
x
The translation vector X. |
System.Single
y
The translation vector Y. |
Returns
Matrix3x3
The result. |
Transpose()
Transposes the Matrix3x3.
Declaration
public void Transpose()
Transpose(Matrix3x3)
Calculates the transpose of the specified Matrix3x3.
Declaration
public static Matrix3x3 Transpose(Matrix3x3 value)
Parameters
Matrix3x3
value
The Matrix3x3 whose transpose is to be calculated. |
Returns
Matrix3x3
The transpose of the specified Matrix3x3. |
Transpose(ref Matrix3x3, out Matrix3x3)
Calculates the transpose of the specified Matrix3x3.
Declaration
public static void Transpose(ref Matrix3x3 value, out Matrix3x3 result)
Parameters
Matrix3x3
value
The Matrix3x3 whose transpose is to be calculated. |
Matrix3x3
result
When the method completes, contains the transpose of the specified Matrix3x3. |
TransposeByRef(ref Matrix3x3, ref Matrix3x3)
Calculates the transpose of the specified Matrix3x3.
Declaration
public static void TransposeByRef(ref Matrix3x3 value, ref Matrix3x3 result)
Parameters
Matrix3x3
value
The Matrix3x3 whose transpose is to be calculated. |
Matrix3x3
result
When the method completes, contains the transpose of the specified Matrix3x3. |
UpperTriangularForm(Matrix3x3)
Brings the Matrix3x3 into upper triangular form using elementary row operations.
Declaration
public static Matrix3x3 UpperTriangularForm(Matrix3x3 value)
Parameters
Matrix3x3
value
The Matrix3x3 to put into upper triangular form. |
Returns
Matrix3x3
The upper triangular Matrix3x3. |
Remarks
If the Matrix3x3 is not invertible (i.e. its determinant is zero) than the result of this method may produce Single.Nan and Single.Inf values. When the Matrix3x3 represents a system of linear equations, than this often means that either no solution exists or an infinite number of solutions exist.
UpperTriangularForm(ref Matrix3x3, out Matrix3x3)
Brings the Matrix3x3 into upper triangular form using elementary row operations.
Declaration
public static void UpperTriangularForm(ref Matrix3x3 value, out Matrix3x3 result)
Parameters
Matrix3x3
value
The Matrix3x3 to put into upper triangular form. |
Matrix3x3
result
When the method completes, contains the upper triangular Matrix3x3. |
Remarks
If the Matrix3x3 is not invertible (i.e. its determinant is zero) than the result of this method may produce Single.Nan and Single.Inf values. When the Matrix3x3 represents a system of linear equations, than this often means that either no solution exists or an infinite number of solutions exist.
Operators
Addition(Matrix3x3, Matrix3x3)
Adds two matrices.
Declaration
public static Matrix3x3 operator +(Matrix3x3 left, Matrix3x3 right)
Parameters
Matrix3x3
left
The first Matrix3x3 to add. |
Matrix3x3
right
The second Matrix3x3 to add. |
Returns
Matrix3x3
The sum of the two matrices. |
Division(Matrix3x3, Matrix3x3)
Divides two matrices.
Declaration
public static Matrix3x3 operator /(Matrix3x3 left, Matrix3x3 right)
Parameters
Matrix3x3
left
The first Matrix3x3 to divide. |
Matrix3x3
right
The second Matrix3x3 to divide. |
Returns
Matrix3x3
The quotient of the two matrices. |
Division(Matrix3x3, Single)
Scales a Matrix3x3 by a given value.
Declaration
public static Matrix3x3 operator /(Matrix3x3 left, float right)
Parameters
Matrix3x3
left
The Matrix3x3 to scale. |
System.Single
right
The amount by which to scale. |
Returns
Matrix3x3
The scaled Matrix3x3. |
Equality(Matrix3x3, Matrix3x3)
Tests for equality between two objects.
Declaration
public static bool operator ==(Matrix3x3 left, Matrix3x3 right)
Parameters
Matrix3x3
left
The first value to compare. |
Matrix3x3
right
The second value to compare. |
Returns
System.Boolean
|
Explicit(Matrix to Matrix3x3)
Convert the 4x4 Matrix to a 3x3 Matrix.
Declaration
public static explicit operator Matrix3x3(Matrix value)
Parameters
Matrix
value
|
Returns
Matrix3x3
A 3x3 Matrix |
Explicit(Matrix3x3 to Matrix)
Convert the 3x3 Matrix to a 4x4 Matrix.
Declaration
public static explicit operator Matrix(Matrix3x3 value)
Parameters
Matrix3x3
value
|
Returns
Matrix
A 4x4 Matrix with zero translation and M44=1 |
Inequality(Matrix3x3, Matrix3x3)
Tests for inequality between two objects.
Declaration
public static bool operator !=(Matrix3x3 left, Matrix3x3 right)
Parameters
Matrix3x3
left
The first value to compare. |
Matrix3x3
right
The second value to compare. |
Returns
System.Boolean
|
Multiply(Matrix3x3, Matrix3x3)
Multiplies two matrices.
Declaration
public static Matrix3x3 operator *(Matrix3x3 left, Matrix3x3 right)
Parameters
Matrix3x3
left
The first Matrix3x3 to multiply. |
Matrix3x3
right
The second Matrix3x3 to multiply. |
Returns
Matrix3x3
The product of the two matrices. |
Multiply(Matrix3x3, Single)
Scales a Matrix3x3 by a given value.
Declaration
public static Matrix3x3 operator *(Matrix3x3 left, float right)
Parameters
Matrix3x3
left
The Matrix3x3 to scale. |
System.Single
right
The amount by which to scale. |
Returns
Matrix3x3
The scaled Matrix3x3. |
Multiply(Single, Matrix3x3)
Scales a Matrix3x3 by a given value.
Declaration
public static Matrix3x3 operator *(float left, Matrix3x3 right)
Parameters
System.Single
left
The amount by which to scale. |
Matrix3x3
right
The Matrix3x3 to scale. |
Returns
Matrix3x3
The scaled Matrix3x3. |
Subtraction(Matrix3x3, Matrix3x3)
Subtracts two matrices.
Declaration
public static Matrix3x3 operator -(Matrix3x3 left, Matrix3x3 right)
Parameters
Matrix3x3
left
The first Matrix3x3 to subtract. |
Matrix3x3
right
The second Matrix3x3 to subtract. |
Returns
Matrix3x3
The difference between the two matrices. |
UnaryNegation(Matrix3x3)
Negates a Matrix3x3.
Declaration
public static Matrix3x3 operator -(Matrix3x3 value)
Parameters
Matrix3x3
value
The Matrix3x3 to negate. |
Returns
Matrix3x3
The negated Matrix3x3. |
UnaryPlus(Matrix3x3)
Assert a Matrix3x3 (return it unchanged).
Declaration
public static Matrix3x3 operator +(Matrix3x3 value)
Parameters
Matrix3x3
value
The Matrix3x3 to assert (unchanged). |
Returns
Matrix3x3
The asserted (unchanged) Matrix3x3. |