Table of Contents

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

m Matrix3x2

Returns

Vector3

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

m Matrix3x2

Returns

Vector3

Get(Matrix3x2, int)

Gets or sets the component at the specified index.

public static float Get(this Matrix3x2 m, int index)

Parameters

m Matrix3x2
index int

The zero-based index of the component to access.

Returns

float

The value of the matrix component, depending on the index.

Exceptions

ArgumentOutOfRangeException

Thrown when the index is 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

m Matrix3x2
row int

The row of the matrix to access.

column int

The column of the matrix to access.

Returns

float

The value of the matrix component, depending on the index.

Exceptions

ArgumentOutOfRangeException

Thrown when the row or columnis 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

m Matrix3x2

Returns

Vector2

Row2(Matrix3x2)

Gets or sets the second row in the matrix; that is M21 and M22.

public static Vector2 Row2(this Matrix3x2 m)

Parameters

m Matrix3x2

Returns

Vector2

Row3(Matrix3x2)

Gets or sets the third row in the matrix; that is M31 and M32.

public static Vector2 Row3(this Matrix3x2 m)

Parameters

m Matrix3x2

Returns

Vector2

ScaleVector(Matrix3x2)

Gets or sets the scale of the matrix; that is M11 and M22.

public static Vector2 ScaleVector(this Matrix3x2 m)

Parameters

m Matrix3x2

Returns

Vector2

Set(ref Matrix3x2, int, int, float)

Sets the specified m.

public static void Set(ref Matrix3x2 m, int row, int column, float value)

Parameters

m Matrix3x2

The m.

row int

The row.

column int

The column.

value float

The value.

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

m Matrix3x2

The m.

index int

The index.

value float

The value.

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

m Matrix3x2

The m.

value Vector3

The value.

SetColumn1(ref Matrix3x2, ref Vector3)

Sets the column1.

public static void SetColumn1(ref Matrix3x2 m, ref Vector3 value)

Parameters

m Matrix3x2

The m.

value Vector3

The value.

SetColumn2(ref Matrix3x2, Vector3)

Sets the column2.

public static void SetColumn2(ref Matrix3x2 m, Vector3 value)

Parameters

m Matrix3x2

The m.

value Vector3

The value.

SetColumn2(ref Matrix3x2, ref Vector3)

Sets the column2.

public static void SetColumn2(ref Matrix3x2 m, ref Vector3 value)

Parameters

m Matrix3x2

The m.

value Vector3

The value.

SetRow1(ref Matrix3x2, Vector2)

Sets the row1.

public static void SetRow1(ref Matrix3x2 m, Vector2 value)

Parameters

m Matrix3x2

The m.

value Vector2

The value.

SetRow1(ref Matrix3x2, ref Vector2)

Sets the row1.

public static void SetRow1(ref Matrix3x2 m, ref Vector2 value)

Parameters

m Matrix3x2

The m.

value Vector2

The value.

SetRow2(ref Matrix3x2, Vector2)

Sets the row2.

public static void SetRow2(ref Matrix3x2 m, Vector2 value)

Parameters

m Matrix3x2

The m.

value Vector2

The value.

SetRow2(ref Matrix3x2, ref Vector2)

Sets the row2.

public static void SetRow2(ref Matrix3x2 m, ref Vector2 value)

Parameters

m Matrix3x2

The m.

value Vector2

The value.

SetRow3(ref Matrix3x2, Vector2)

Sets the row3.

public static void SetRow3(ref Matrix3x2 m, Vector2 value)

Parameters

m Matrix3x2

The m.

value Vector2

The value.

SetRow3(ref Matrix3x2, ref Vector2)

Sets the row3.

public static void SetRow3(ref Matrix3x2 m, ref Vector2 value)

Parameters

m Matrix3x2

The m.

value Vector2

The value.

SetScaleVector(ref Matrix3x2, Vector2)

Sets the scale vector.

public static void SetScaleVector(ref Matrix3x2 m, Vector2 value)

Parameters

m Matrix3x2

The m.

value Vector2

The value.

SetScaleVector(ref Matrix3x2, ref Vector2)

Sets the scale vector.

public static void SetScaleVector(ref Matrix3x2 m, ref Vector2 value)

Parameters

m Matrix3x2

The m.

value Vector2

The value.

SetTranslation(ref Matrix3x2, Vector2)

Sets the translation.

public static void SetTranslation(ref Matrix3x2 m, Vector2 value)

Parameters

m Matrix3x2

The m.

value Vector2

The value.

SetTranslation(ref Matrix3x2, ref Vector2)

Sets the translation.

public static void SetTranslation(ref Matrix3x2 m, ref Vector2 value)

Parameters

m Matrix3x2

The m.

value Vector2

The value.

Skew(float, float)

Creates a skew matrix.

public static Matrix3x2 Skew(float angleX, float angleY)

Parameters

angleX float

Angle of skew along the X-axis in radians.

angleY float

Angle 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

angleX float

Angle of skew along the X-axis in radians.

angleY float

Angle of skew along the Y-axis in radians.

result Matrix3x2

When 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

start Matrix3x2

Start matrix.

end Matrix3x2

End matrix.

amount float

Value 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

start Matrix3x2

Start matrix.

end Matrix3x2

End matrix.

amount float

Value between 0 and 1 indicating the weight of end.

result Matrix3x2

When 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

m Matrix3x2

Returns

float[]

A sixteen-element array containing the components of the matrix.

ToMatrix3x2(Matrix4x4)

Performs an implicit conversion from Matrix4x4 to Matrix3x2.

public static Matrix3x2 ToMatrix3x2(this Matrix4x4 matrix)

Parameters

matrix Matrix4x4

The 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

matrix Matrix3x2

The matrix to use as a transformation matrix.

point Vector2

The 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

matrix Matrix3x2

The matrix to use as a transformation matrix.

point Vector2

The original vector to apply the transformation.

result Vector2

The result of the transformation for the input vector.

Translation(Vector2)

Create a matrix from translation vector.

public static Matrix3x2 Translation(Vector2 value)

Parameters

value Vector2

Returns

Matrix3x2