# AffineTransform

> An affine transformation type.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Mathematics](/engine/6000.5/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule
* **Implements:** [IEquatable\<AffineTransform>](https://learn.microsoft.com/dotnet/api/system.iequatable-1), [IFormattable](https://learn.microsoft.com/dotnet/api/system.iformattable)

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

## Fields

| Value                                                                         | Description                                               |
| ----------------------------------------------------------------------------- | --------------------------------------------------------- |
| [rs](/engine/6000.5/script-reference/unity/mathematics/affinetransform/rs.md) | The rotation and scale part of the affine transformation. |
| [t](/engine/6000.5/script-reference/unity/mathematics/affinetransform/t.md)   | The translation part of the affine transformation.        |

## Static Fields

| Value                                                                                     | Description                                             |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| [identity](/engine/6000.5/script-reference/unity/mathematics/affinetransform/identity.md) | An AffineTransform representing the identity transform. |
| [zero](/engine/6000.5/script-reference/unity/mathematics/affinetransform/zero.md)         | An AffineTransform zero value.                          |

## Constructors

| Constructor                                                                                                                                                                                                              | Description                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AffineTransform(Unity.Mathematics.float3,Unity.Mathematics.float3x3)](/engine/6000.5/script-reference/unity/mathematics/affinetransform/ctor.md#affinetransform\(float3-float3x3\))                                     | Constructs an AffineTransform from a translation represented by float3 vector and a float3x3 matrix representing both rotation and scale.                            |
| [AffineTransform(Unity.Mathematics.float3,Unity.Mathematics.quaternion)](/engine/6000.5/script-reference/unity/mathematics/affinetransform/ctor.md#affinetransform\(float3-quaternion\))                                 | Constructs an AffineTransform from a translation represented by a float3 vector and rotation represented by a unit quaternion.                                       |
| [AffineTransform(Unity.Mathematics.float3,Unity.Mathematics.quaternion,Unity.Mathematics.float3)](/engine/6000.5/script-reference/unity/mathematics/affinetransform/ctor.md#affinetransform\(float3-quaternion-float3\)) | Constructs an AffineTransform from a translation represented by a float3 vector, rotation represented by a unit quaternion and scale represented by a float3 vector. |
| [AffineTransform(Unity.Mathematics.float3x3)](/engine/6000.5/script-reference/unity/mathematics/affinetransform/ctor.md#affinetransform\(float3x3\))                                                                     | Constructs an AffineTransform from float3x3 matrix representating both rotation and scale.                                                                           |
| [AffineTransform(Unity.Mathematics.float3x4)](/engine/6000.5/script-reference/unity/mathematics/affinetransform/ctor.md#affinetransform\(float3x4\))                                                                     | Constructs an AffineTransform from a float3x4 matrix.                                                                                                                |
| [AffineTransform(Unity.Mathematics.float4x4)](/engine/6000.5/script-reference/unity/mathematics/affinetransform/ctor.md#affinetransform\(float4x4\))                                                                     | Constructs an AffineTransform from a float4x4 matrix.                                                                                                                |
| [AffineTransform(Unity.Mathematics.RigidTransform)](/engine/6000.5/script-reference/unity/mathematics/affinetransform/ctor.md#affinetransform\(rigidtransform\))                                                         | Constructs an AffineTransform from a RigidTransform.                                                                                                                 |

## Methods

| Method                                                                                          | Description                                                                               |
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| [Equals](/engine/6000.5/script-reference/unity/mathematics/affinetransform/equals.md)           | Returns true if the AffineTransform is equal to a given AffineTransform, false otherwise. |
| [GetHashCode](/engine/6000.5/script-reference/unity/mathematics/affinetransform/gethashcode.md) | Returns a hash code for the AffineTransform.                                              |
| [ToString](/engine/6000.5/script-reference/unity/mathematics/affinetransform/tostring.md)       | Returns a string representation of the AffineTransform.                                   |

## Operators

| Operator                                                                                     | Description                      |
| -------------------------------------------------------------------------------------------- | -------------------------------- |
| [float3x4](/engine/6000.5/script-reference/unity/mathematics/affinetransform/op-implicit.md) | Implicit float3x4 cast operator. |
| [float4x4](/engine/6000.5/script-reference/unity/mathematics/affinetransform/op-implicit.md) | Implicit float4x4 cast operator. |
