[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.Matrix3x2

Struct Matrix3x2

Namespace
GrapeCity.Documents.DX
Assembly
GcDocs.DX.Windows.dll

Direct2D Matrix3x2 3x2.

public struct Matrix3x2 : IEquatable<Matrix3x2>, IFormattable
Implements
System.IEquatable<T><Matrix3x2>
System.IFormattable
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()

Constructors

Matrix3x2(float, float, float, float, float, float)

Initializes a new instance of the Matrix3x2 struct.

public Matrix3x2(float M11, float M12, float M21, float M22, float M31, float M32)

Parameters

M11 float

The value to assign at row 1 column 1 of the matrix.

M12 float

The value to assign at row 1 column 2 of the matrix.

M21 float

The value to assign at row 2 column 1 of the matrix.

M22 float

The value to assign at row 2 column 2 of the matrix.

M31 float

The value to assign at row 3 column 1 of the matrix.

M32 float

The value to assign at row 3 column 2 of the matrix.

Matrix3x2(float)

Initializes a new instance of the Matrix3x2 struct.

public Matrix3x2(float value)

Parameters

value float

The value that will be assigned to all components.

Matrix3x2(float[])

Initializes a new instance of the Matrix3x2 struct.

public Matrix3x2(float[] values)

Parameters

values float[]

The values to assign to the components of the matrix. This must be an array with six elements.

Exceptions

System.ArgumentNullException

Thrown when values is null.

System.ArgumentOutOfRangeException

Thrown when values contains more or less than sixteen elements.

Fields

Identity

Gets the identity matrix.

public static readonly Matrix3x2 Identity

Field Value

Matrix3x2

M11

Element (1,1)

public float M11

Field Value

float

M12

Element (1,2)

public float M12

Field Value

float

M21

Element (2,1)

public float M21

Field Value

float

M22

Element (2,2)

public float M22

Field Value

float

M31

Element (3,1)

public float M31

Field Value

float

M32

Element (3,2)

public float M32

Field Value

float

SizeInBytes

The size of the Matrix3x2 type, in bytes.

public const int SizeInBytes = 24

Field Value

int

Properties

Column1

Gets or sets the first column in the matrix; that is M11, M21, M31.

public Vector3 Column1 { get; set; }

Property Value

Vector3

Column2

Gets or sets the second column in the matrix; that is M12, M22, and M32.

public Vector3 Column2 { get; set; }

Property Value

Vector3

Determinant

Calculates the determinant of this matrix.

public float Determinant { get; }

Property Value

float

IsIdentity

Gets a value indicating whether this instance is an identity matrix.

public bool IsIdentity { get; }

Property Value

bool

this[int, int]

Gets or sets the component at the specified index.

public float this[int row, int column] { get; set; }

Parameters

row int

The row of the matrix to access.

column int

The column of the matrix to access.

Property Value

float

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

Exceptions

System.ArgumentOutOfRangeException

Thrown when the row or columnis out of the range [0, 3].

this[int]

Gets or sets the component at the specified index.

public float this[int index] { get; set; }

Parameters

index int

The zero-based index of the component to access.

Property Value

float

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

Exceptions

System.ArgumentOutOfRangeException

Thrown when the index is out of the range [0, 5].

Row1

Gets or sets the first row in the matrix; that is M11, M12.

public Vector2 Row1 { get; set; }

Property Value

Vector2

Row2

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

public Vector2 Row2 { get; set; }

Property Value

Vector2

Row3

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

public Vector2 Row3 { get; set; }

Property Value

Vector2

ScaleVector

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

public Vector2 ScaleVector { get; set; }

Property Value

Vector2

TranslationVector

Gets or sets the translation of the matrix; that is M31, M32.

public Vector2 TranslationVector { get; set; }

Property Value

Vector2

Methods

Add(in Matrix3x2, in Matrix3x2)

Determines the sum of two matrices.

public static Matrix3x2 Add(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2

The first matrix to add.

right Matrix3x2

The second matrix to add.

Returns

Matrix3x2

The sum of the two matrices.

Divide(in Matrix3x2, float)

Divides a matrix by the given value.

public static Matrix3x2 Divide(in Matrix3x2 left, float right)

Parameters

left Matrix3x2

The matrix to scale.

right float

The amount by which to scale.

Returns

Matrix3x2

The resulting matrix.

Equals(Matrix3x2)

Determines whether the specified Matrix3x2 is equal to this instance.

public bool Equals(Matrix3x2 other)

Parameters

other Matrix3x2

Returns

bool

Equals(in Matrix3x2, in Matrix3x2)

Determines whether two instances of Matrix3x2 are equal.

public static bool Equals(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2
right Matrix3x2

Returns

bool

Equals(object)

Determines whether the specified object is equal to this instance.

public override bool Equals(object value)

Parameters

value object

Returns

bool

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

HadamardDivide(in Matrix3x2, in Matrix3x2)

Element-wise division of two matrices.

public static Matrix3x2 HadamardDivide(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2

The first matrix.

right Matrix3x2

The second matrix.

Returns

Matrix3x2

The result of division of the two matrices.

HadamardProduct(in Matrix3x2, in Matrix3x2)

Determines the Hadamard (element-wise) product of two matrices.

public static Matrix3x2 HadamardProduct(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2

The first matrix to multiply.

right Matrix3x2

The second matrix to multiply.

Returns

Matrix3x2

The Hadamard (element-wise) product of the two matrices.

Invert(in Matrix3x2)

Inverts the specified matrix.

public static Matrix3x2 Invert(in Matrix3x2 matrix)

Parameters

matrix Matrix3x2

Returns

Matrix3x2

Lerp(in Matrix3x2, in Matrix3x2, float)

Performs a linear interpolation between two matrices based on the given weighting.

public static Matrix3x2 Lerp(in Matrix3x2 matrix1, in Matrix3x2 matrix2, float amount)

Parameters

matrix1 Matrix3x2

The first matrix.

matrix2 Matrix3x2

The second matrix.

amount float

A value between 0 and 1 that indicates the weight of matrix2.

Returns

Matrix3x2

The interpolated matrix.

Multiply(in Matrix3x2, in Matrix3x2)

Determines the product of two matrices.

public static Matrix3x2 Multiply(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2

The first matrix to multiply.

right Matrix3x2

The second matrix to multiply.

Returns

Matrix3x2

The product of the two matrices.

Multiply(in Matrix3x2, float)

Scales a matrix by the given value.

public static Matrix3x2 Multiply(in Matrix3x2 left, float right)

Parameters

left Matrix3x2

The matrix to scale.

right float

The amount by which to scale.

Returns

Matrix3x2

The scaled matrix.

Negate(in Matrix3x2)

Negates a matrix in-place.

public static Matrix3x2 Negate(in Matrix3x2 value)

Parameters

value Matrix3x2

The matrix to be negated.

Returns

Matrix3x2

NegateRef(ref Matrix3x2)

Negates a matrix in-place.

public static void NegateRef(ref Matrix3x2 value)

Parameters

value Matrix3x2

The matrix to be negated.

Rotation(float, Point2F)

Creates a matrix that rotates.

public static Matrix3x2 Rotation(float degrees, Point2F center)

Parameters

degrees float
center Point2F

Returns

Matrix3x2

Rotation(float)

Creates a matrix that rotates.

public static Matrix3x2 Rotation(float degrees)

Parameters

degrees float

Angle of rotation, in degrees. Angles are measured clockwise when looking along the rotation axis.

Returns

Matrix3x2

The created rotation matrix.

Scale(Size2F, Point2F)

Creates a scale transformation matrix.

public static Matrix3x2 Scale(Size2F size, Point2F center)

Parameters

size Size2F
center Point2F

Returns

Matrix3x2

Scale(Size2F)

Creates a scale transformation matrix.

public static Matrix3x2 Scale(Size2F size)

Parameters

size Size2F

Returns

Matrix3x2

Scale(Vector2, Point2F)

Creates a scale transformation matrix.

public static Matrix3x2 Scale(Vector2 scales, Point2F center)

Parameters

scales Vector2
center Point2F

Returns

Matrix3x2

Scale(Vector2)

Creates a scale transformation matrix.

public static Matrix3x2 Scale(Vector2 scales)

Parameters

scales Vector2

Returns

Matrix3x2

Scale(float, Point2F)

Creates a scale transformation matrix.

public static Matrix3x2 Scale(float scale, Point2F center)

Parameters

scale float
center Point2F

Returns

Matrix3x2

Scale(float, float, Point2F)

Creates a scale transformation matrix.

public static Matrix3x2 Scale(float xScale, float yScale, Point2F center)

Parameters

xScale float
yScale float
center Point2F

Returns

Matrix3x2

Scale(float, float)

Creates a scale transformation matrix.

public static Matrix3x2 Scale(float xScale, float yScale)

Parameters

xScale float
yScale float

Returns

Matrix3x2

Scale(float)

Creates a scale transformation matrix.

public static Matrix3x2 Scale(float scale)

Parameters

scale float

Returns

Matrix3x2

Skew(float, float, Point2F)

Creates a skew transformation that has the specified x-axis angle, y-axis angle, and center point.

public static Matrix3x2 Skew(float radiansX, float radiansY, Point2F center)

Parameters

radiansX float
radiansY float
center Point2F

Returns

Matrix3x2

Skew(float, float)

Creates a skew transformation that has the specified x-axis angle and y-axis angle in radians.

public static Matrix3x2 Skew(float radiansX, float radiansY)

Parameters

radiansX float
radiansY float

Returns

Matrix3x2

Subtract(in Matrix3x2, in Matrix3x2)

Determines the difference between two matrices.

public static Matrix3x2 Subtract(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2

The first matrix to subtract.

right Matrix3x2

The second matrix to subtract.

Returns

Matrix3x2

The difference between the two matrices.

ToArray()

Creates an array containing the elements of the matrix.

public float[] ToArray()

Returns

float[]

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

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

ToString(IFormatProvider)

Returns a string that represents this instance.

public string ToString(IFormatProvider formatProvider)

Parameters

formatProvider System.IFormatProvider

The format provider.

Returns

string

A string that represents this instance.

ToString(string, IFormatProvider)

Returns a string that represents this instance.

public string ToString(string format, IFormatProvider formatProvider)

Parameters

format string

The format.

formatProvider System.IFormatProvider

The format provider.

Returns

string

A string that represents this instance.

ToString(string)

Returns a string that represents this instance.

public string ToString(string format)

Parameters

format string

The format.

Returns

string

A string that represents this instance.

TransformPoint(in Matrix3x2, Point2F)

Transforms a point by this matrix.

public static Point2F TransformPoint(in Matrix3x2 matrix, Point2F point)

Parameters

matrix Matrix3x2

The matrix to use as a tranformation matrix.

point Point2F

The original point to apply the transformation.

Returns

Point2F

The result of the transformation for the input point.

Translation(Size2F)

Creates a translation matrix using the specified offsets.

public static Matrix3x2 Translation(Size2F value)

Parameters

value Size2F

The offset for all three coordinate planes.

Returns

Matrix3x2

The created translation matrix.

Translation(Vector2)

Creates a translation matrix using the specified offsets.

public static Matrix3x2 Translation(Vector2 value)

Parameters

value Vector2

The offset for all three coordinate planes.

Returns

Matrix3x2

The created translation matrix.

Translation(float, float)

Creates a translation matrix using the specified offsets.

public static Matrix3x2 Translation(float x, float y)

Parameters

x float

X-coordinate offset.

y float

Y-coordinate offset.

Returns

Matrix3x2

The created translation matrix.

Operators

operator +(in Matrix3x2, in Matrix3x2)

Adds two matricies.

public static Matrix3x2 operator +(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2

The first matrix to add.

right Matrix3x2

The second matrix to add.

Returns

Matrix3x2

The sum of the two matricies.

operator /(in Matrix3x2, float)

Divides a matrix by a given value.

public static Matrix3x2 operator /(in Matrix3x2 left, float right)

Parameters

left Matrix3x2

The matrix to divide.

right float

The amount by which to divide.

Returns

Matrix3x2

The resulting matrix.

operator ==(in Matrix3x2, in Matrix3x2)

Tests for equality between two objects.

public static bool operator ==(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2

The first value to compare.

right Matrix3x2

The second value to compare.

Returns

bool

implicit operator Matrix3x2(Matrix4x4)

Performs an implicit conversion from Matrix4x4 to Matrix3x2.

public static implicit operator Matrix3x2(Matrix4x4 matrix)

Parameters

matrix Matrix4x4

The matrix.

Returns

Matrix3x2

The result of the conversion.

operator !=(in Matrix3x2, in Matrix3x2)

Tests for inequality between two objects.

public static bool operator !=(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2

The first value to compare.

right Matrix3x2

The second value to compare.

Returns

bool

operator *(in Matrix3x2, in Matrix3x2)

Calculates a matrix product for the given matrices.

public static Matrix3x2 operator *(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2

The first matrix.

right Matrix3x2

The second matrix.

Returns

Matrix3x2

The result of the matrix multiplication.

operator *(in Matrix3x2, float)

Scales a matrix by a given value.

public static Matrix3x2 operator *(in Matrix3x2 left, float right)

Parameters

left Matrix3x2

The matrix to scale.

right float

The amount by which to scale.

Returns

Matrix3x2

The scaled matrix.

operator *(float, in Matrix3x2)

Scales a matrix by a given value.

public static Matrix3x2 operator *(float left, in Matrix3x2 right)

Parameters

left float

The amount by which to scale.

right Matrix3x2

The matrix to scale.

Returns

Matrix3x2

The scaled matrix.

operator -(in Matrix3x2, in Matrix3x2)

Subtracts two matricies.

public static Matrix3x2 operator -(in Matrix3x2 left, in Matrix3x2 right)

Parameters

left Matrix3x2

The first matrix to subtract.

right Matrix3x2

The second matrix to subtract.

Returns

Matrix3x2

The difference between the two matricies.

operator -(in Matrix3x2)

Negates a matrix.

public static Matrix3x2 operator -(in Matrix3x2 value)

Parameters

value Matrix3x2

The matrix to negate.

Returns

Matrix3x2

The negated matrix.