# Matrix2D

> A 2x3 transformation matrix used for 2D operations.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.VectorGraphics](/engine/6000.7/script-reference/unity/vectorgraphics.md)
* **Assembly:** UnityEngine.VectorGraphicsModule
* **Implements:** [IEquatable\<Matrix2D>](https://learn.microsoft.com/dotnet/api/system.iequatable-1), [IFormattable](https://learn.microsoft.com/dotnet/api/system.iformattable)

```csharp
public struct Matrix2D : IEquatable<Matrix2D>, IFormattable
```

## Fields

| Value                                                                       | Description                |
| --------------------------------------------------------------------------- | -------------------------- |
| [m00](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/m00.md) | The matrix member at (0,0) |
| [m01](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/m01.md) | The matrix member at (0,1) |
| [m02](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/m02.md) | The matrix member at (0,2) |
| [m10](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/m10.md) | The matrix member at (1,0) |
| [m11](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/m11.md) | The matrix member at (1,1) |
| [m12](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/m12.md) | The matrix member at (1,2) |

## Constructors

| Constructor                                                                                                                                    | Description                                |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| [Matrix2D(UnityEngine.Vector2,UnityEngine.Vector2,UnityEngine.Vector2)](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/ctor.md) | Initializes a Matrix2D with column vectors |

## Properties

| Property                                                                          | Description                                          |
| --------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [this\[\]](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/item.md) | Access element at sequential index (0..5 inclusive). |

## Static Properties

| Property                                                                              | Description                                                 |
| ------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [identity](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/identity.md) | Returns the identity matrix (read-only).                    |
| [zero](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/zero.md)         | Returns a matrix with all elements set to zero (read-only). |

## Methods

| Method                                                                                            | Description                                                |
| ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [Equals](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/equals.md)                 | Checks if two matrices are equal.                          |
| [GetColumn](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/getcolumn.md)           | Gets a column of the matrix.                               |
| [GetHashCode](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/gethashcode.md)       | Gets a hashcode of the matrix.                             |
| [GetRow](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/getrow.md)                 | Gets a row of the matrix.                                  |
| [Inverse](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/inverse.md)               | Computes the inverse of the matrix.                        |
| [MultiplyPoint](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/multiplypoint.md)   | Transforms a position by this matrix (effectively by 2x3). |
| [MultiplyVector](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/multiplyvector.md) | Transforms a direction by this matrix.                     |
| [SetColumn](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/setcolumn.md)           | Sets a column of the matrix.                               |
| [SetRow](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/setrow.md)                 | Sets a row of the matrix.                                  |
| [ToString](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/tostring.md)             | Returns a string representation of the matrix.             |

## Static Methods

| Method                                                                                  | Description                                |
| --------------------------------------------------------------------------------------- | ------------------------------------------ |
| [RotateLH](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/rotatelh.md)   | Creates a left-hand side rotation matrix.  |
| [RotateRH](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/rotaterh.md)   | Creates a right-hand side rotation matrix. |
| [Scale](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/scale.md)         | Creates a scaling matrix.                  |
| [SkewX](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/skewx.md)         | Creates a skew matrix on X.                |
| [SkewY](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/skewy.md)         | Creates a skew matrix on U.                |
| [Translate](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/translate.md) | Creates a translation matrix.              |

## Operators

| Operator                                                                                      | Description                           |
| --------------------------------------------------------------------------------------------- | ------------------------------------- |
| [operator ==](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/op-equality.md)   | Checks if two matrices are equal.     |
| [operator !=](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/op-inequality.md) | Checks if two matrices are not equal. |
| [operator \*](/engine/6000.7/script-reference/unity/vectorgraphics/matrix2d/op-multiply.md)   | Multiplies two matrices.              |
