Class Matrix3x2Helper
- Namespace
- HelixToolkit.Maths
- Assembly
- HelixToolkit.Maths.dll
Direct2D Matrix3x2. Supports implicit cast from Matrix4x4.
public static class Matrix3x2Helper
- Inheritance
-
Matrix3x2Helper
- Inherited Members
Fields
Identity
Gets the identity matrix.
public static readonly Matrix3x2 Identity
Field Value
- Matrix3x2
The identity matrix.
Methods
Column1(Matrix3x2)
Gets or sets the first column in the matrix; that is M11, M21, and M31.
public static Vector3 Column1(this Matrix3x2 m)
Parameters
Returns
Column2(Matrix3x2)
Gets or sets the second column in the matrix; that is M12, M22, and M32.
public static Vector3 Column2(this Matrix3x2 m)
Parameters
Returns
Get(Matrix3x2, int)
Gets or sets the component at the specified index.
public static float Get(this Matrix3x2 m, int index)
Parameters
Returns
- float
The value of the matrix component, depending on the index.
Exceptions
- ArgumentOutOfRangeException
Thrown when the
indexis out of the range [0, 5].
Get(Matrix3x2, int, int)
Gets or sets the component at the specified index.
public static float Get(this Matrix3x2 m, int row, int column)
Parameters
Returns
- float
The value of the matrix component, depending on the index.
Exceptions
- ArgumentOutOfRangeException
Thrown when the
roworcolumnis out of the range [0, 3].
Row1(Matrix3x2)
Gets or sets the first row in the matrix; that is M11 and M12.
m>
public static Vector2 Row1(this Matrix3x2 m)
Parameters
Returns
Row2(Matrix3x2)
Gets or sets the second row in the matrix; that is M21 and M22.
public static Vector2 Row2(this Matrix3x2 m)
Parameters
Returns
Row3(Matrix3x2)
Gets or sets the third row in the matrix; that is M31 and M32.
public static Vector2 Row3(this Matrix3x2 m)
Parameters
Returns
ScaleVector(Matrix3x2)
Gets or sets the scale of the matrix; that is M11 and M22.
public static Vector2 ScaleVector(this Matrix3x2 m)
Parameters
Returns
Set(ref Matrix3x2, int, int, float)
Sets the specified m.
public static void Set(ref Matrix3x2 m, int row, int column, float value)
Parameters
Exceptions
- ArgumentOutOfRangeException
row - Rows and columns for matrices run from 0 to 2, inclusive. or column - Rows and columns for matrices run from 0 to 1, inclusive.
Set(ref Matrix3x2, int, float)
Sets the specified m.
public static void Set(ref Matrix3x2 m, int index, float value)
Parameters
Exceptions
- ArgumentOutOfRangeException
index - Indices for Matrix3x2 run from 0 to 5, inclusive.
SetColumn1(ref Matrix3x2, Vector3)
Sets the column1.
public static void SetColumn1(ref Matrix3x2 m, Vector3 value)
Parameters
SetColumn1(ref Matrix3x2, ref Vector3)
Sets the column1.
public static void SetColumn1(ref Matrix3x2 m, ref Vector3 value)
Parameters
SetColumn2(ref Matrix3x2, Vector3)
Sets the column2.
public static void SetColumn2(ref Matrix3x2 m, Vector3 value)
Parameters
SetColumn2(ref Matrix3x2, ref Vector3)
Sets the column2.
public static void SetColumn2(ref Matrix3x2 m, ref Vector3 value)
Parameters
SetRow1(ref Matrix3x2, Vector2)
Sets the row1.
public static void SetRow1(ref Matrix3x2 m, Vector2 value)
Parameters
SetRow1(ref Matrix3x2, ref Vector2)
Sets the row1.
public static void SetRow1(ref Matrix3x2 m, ref Vector2 value)
Parameters
SetRow2(ref Matrix3x2, Vector2)
Sets the row2.
public static void SetRow2(ref Matrix3x2 m, Vector2 value)
Parameters
SetRow2(ref Matrix3x2, ref Vector2)
Sets the row2.
public static void SetRow2(ref Matrix3x2 m, ref Vector2 value)
Parameters
SetRow3(ref Matrix3x2, Vector2)
Sets the row3.
public static void SetRow3(ref Matrix3x2 m, Vector2 value)
Parameters
SetRow3(ref Matrix3x2, ref Vector2)
Sets the row3.
public static void SetRow3(ref Matrix3x2 m, ref Vector2 value)
Parameters
SetScaleVector(ref Matrix3x2, Vector2)
Sets the scale vector.
public static void SetScaleVector(ref Matrix3x2 m, Vector2 value)
Parameters
SetScaleVector(ref Matrix3x2, ref Vector2)
Sets the scale vector.
public static void SetScaleVector(ref Matrix3x2 m, ref Vector2 value)
Parameters
SetTranslation(ref Matrix3x2, Vector2)
Sets the translation.
public static void SetTranslation(ref Matrix3x2 m, Vector2 value)
Parameters
SetTranslation(ref Matrix3x2, ref Vector2)
Sets the translation.
public static void SetTranslation(ref Matrix3x2 m, ref Vector2 value)
Parameters
Skew(float, float)
Creates a skew matrix.
public static Matrix3x2 Skew(float angleX, float angleY)
Parameters
angleXfloatAngle of skew along the X-axis in radians.
angleYfloatAngle of skew along the Y-axis in radians.
Returns
- Matrix3x2
The created skew matrix.
Skew(float, float, out Matrix3x2)
Creates a skew matrix.
public static void Skew(float angleX, float angleY, out Matrix3x2 result)
Parameters
angleXfloatAngle of skew along the X-axis in radians.
angleYfloatAngle of skew along the Y-axis in radians.
resultMatrix3x2When the method completes, contains the created skew matrix.
SmoothStep(Matrix3x2, Matrix3x2, float)
Performs a cubic interpolation between two matrices.
public static Matrix3x2 SmoothStep(Matrix3x2 start, Matrix3x2 end, float amount)
Parameters
startMatrix3x2Start matrix.
endMatrix3x2End matrix.
amountfloatValue between 0 and 1 indicating the weight of
end.
Returns
- Matrix3x2
The cubic interpolation of the two matrices.
SmoothStep(ref Matrix3x2, ref Matrix3x2, float, out Matrix3x2)
Performs a cubic interpolation between two matrices.
public static void SmoothStep(ref Matrix3x2 start, ref Matrix3x2 end, float amount, out Matrix3x2 result)
Parameters
startMatrix3x2Start matrix.
endMatrix3x2End matrix.
amountfloatValue between 0 and 1 indicating the weight of
end.resultMatrix3x2When the method completes, contains the cubic interpolation of the two matrices.
ToArray(Matrix3x2)
Creates an array containing the elements of the matrix.
public static float[] ToArray(this Matrix3x2 m)
Parameters
Returns
- float[]
A sixteen-element array containing the components of the matrix.
ToMatrix3x2(Matrix4x4)
public static Matrix3x2 ToMatrix3x2(this Matrix4x4 matrix)
Parameters
matrixMatrix4x4The matrix.
Returns
- Matrix3x2
The result of the conversion.
TransformPoint(Matrix3x2, Vector2)
Transforms a vector by this matrix.
public static Vector2 TransformPoint(Matrix3x2 matrix, Vector2 point)
Parameters
matrixMatrix3x2The matrix to use as a transformation matrix.
pointVector2The original vector to apply the transformation.
Returns
- Vector2
The result of the transformation for the input vector.
TransformPoint(ref Matrix3x2, ref Vector2, out Vector2)
Transforms a vector by this matrix.
public static void TransformPoint(ref Matrix3x2 matrix, ref Vector2 point, out Vector2 result)
Parameters
matrixMatrix3x2The matrix to use as a transformation matrix.
pointVector2The original vector to apply the transformation.
resultVector2The result of the transformation for the input vector.
Translation(Vector2)
Create a matrix from translation vector.
public static Matrix3x2 Translation(Vector2 value)
Parameters
valueVector2