# rotate

> Returns the result of rotating a float3 vector by an AffineTransform.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Mathematics](/engine/6000.6/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule

## rotate(AffineTransform, float3)

Returns the result of rotating a float3 vector by an AffineTransform.

```csharp
public static float3 rotate(AffineTransform a, float3 dir)
```

### Parameters

**** (\[AffineTransform]\(/engine/6000.6/script-reference/unity/mathematics/affinetransform)): The AffineTransform.**** (\[float3]\(/engine/6000.6/script-reference/unity/mathematics/float3)): The direction vector to rotate.

### Returns

| Type                                                                  | Description                   |
| --------------------------------------------------------------------- | ----------------------------- |
| [float3](/engine/6000.6/script-reference/unity/mathematics/float3.md) | The rotated direction vector. |

## rotate(double4x4, double3)

Return the result of rotating a double3 vector by a double4x4 matrix

```csharp
public static double3 rotate(double4x4 a, double3 b)
```

### Parameters

**** (\[double4x4]\(/engine/6000.6/script-reference/unity/mathematics/double4x4)): Left hand side matrix argument that specifies the rotation.**** (\[double3]\(/engine/6000.6/script-reference/unity/mathematics/double3)): Right hand side vector argument to be rotated.

### Returns

| Type                                                                    | Description         |
| ----------------------------------------------------------------------- | ------------------- |
| [double3](/engine/6000.6/script-reference/unity/mathematics/double3.md) | The rotated vector. |

## rotate(float4x4, float3)

Return the result of rotating a float3 vector by a float4x4 matrix

```csharp
public static float3 rotate(float4x4 a, float3 b)
```

### Parameters

**** (\[float4x4]\(/engine/6000.6/script-reference/unity/mathematics/float4x4)): Left hand side matrix argument that specifies the rotation.**** (\[float3]\(/engine/6000.6/script-reference/unity/mathematics/float3)): Right hand side vector argument to be rotated.

### Returns

| Type                                                                  | Description         |
| --------------------------------------------------------------------- | ------------------- |
| [float3](/engine/6000.6/script-reference/unity/mathematics/float3.md) | The rotated vector. |

## rotate(quaternion, float3)

Returns the result of rotating a vector by a unit quaternion.

```csharp
public static float3 rotate(quaternion q, float3 v)
```

### Parameters

**** (\[quaternion]\(/engine/6000.6/script-reference/unity/mathematics/quaternion)): The quaternion rotation.**** (\[float3]\(/engine/6000.6/script-reference/unity/mathematics/float3)): The vector to rotate.

### Returns

| Type                                                                  | Description                               |
| --------------------------------------------------------------------- | ----------------------------------------- |
| [float3](/engine/6000.6/script-reference/unity/mathematics/float3.md) | The rotation of vector v by quaternion q. |

## rotate(RigidTransform, float3)

Returns the result of rotating a float3 vector by a RigidTransform.

```csharp
public static float3 rotate(RigidTransform a, float3 dir)
```

### Parameters

**** (\[RigidTransform]\(/engine/6000.6/script-reference/unity/mathematics/rigidtransform)): The RigidTransform.**** (\[float3]\(/engine/6000.6/script-reference/unity/mathematics/float3)): The direction vector to rotate.

### Returns

| Type                                                                  | Description                   |
| --------------------------------------------------------------------- | ----------------------------- |
| [float3](/engine/6000.6/script-reference/unity/mathematics/float3.md) | The rotated direction vector. |
