Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Matrix2D

A 2x3 transformation matrix used for 2D operations.
Read time 1 minuteLast updated 9 days ago

Definition

public struct Matrix2D : IEquatable<Matrix2D>, IFormattable

Fields

Value

Description

m00The matrix member at (0,0)
m01The matrix member at (0,1)
m02The matrix member at (0,2)
m10The matrix member at (1,0)
m11The matrix member at (1,1)
m12The matrix member at (1,2)

Constructors

Constructor

Description

Matrix2D(UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Vector2)Initializes a Matrix2D with column vectors

Properties

Property

Description

this[]Access element at sequential index (0..5 inclusive).

Static Properties

Property

Description

identityReturns the identity matrix (read-only).
zeroReturns a matrix with all elements set to zero (read-only).

Methods

Method

Description

EqualsChecks if two matrices are equal.
GetColumnGets a column of the matrix.
GetHashCodeGets a hashcode of the matrix.
GetRowGets a row of the matrix.
InverseComputes the inverse of the matrix.
MultiplyPointTransforms a position by this matrix (effectively by 2x3).
MultiplyVectorTransforms a direction by this matrix.
SetColumnSets a column of the matrix.
SetRowSets a row of the matrix.
ToStringReturns a string representation of the matrix.

Static Methods

Method

Description

RotateLHCreates a left-hand side rotation matrix.
RotateRHCreates a right-hand side rotation matrix.
ScaleCreates a scaling matrix.
SkewXCreates a skew matrix on X.
SkewYCreates a skew matrix on U.
TranslateCreates a translation matrix.

Operators

Operator

Description

operator ==Checks if two matrices are equal.
operator !=Checks if two matrices are not equal.
operator *Multiplies two matrices.