---
title: unwind
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/mathematics/math/unwind
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/mathematics/math/unwind.md
last_updated: 2026-11-20
generated_at: 2026-11-25T22:12:33.469Z
locale: en-us
---

# unwind

> Returns the angle x wrapped to the range -PI to PI.

## Definition

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

## unwind(float)

Returns the angle x wrapped to the range -PI to PI.

```csharp
public static float unwind(float x)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Angle in radians.

### Returns

| Type                                                          | Description                                  |
| ------------------------------------------------------------- | -------------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The equivalent angle in the range -PI to PI. |

### Remarks

The result is congruent to x modulo 2 \* PI and lies in the half-open range \[-PI, PI).

## unwind(float2)

Returns the componentwise angles of a float2 vector wrapped to the range -PI to PI.

```csharp
public static float2 unwind(float2 x)
```

### Parameters

**** (\[float2]\(/engine/7000.0/script-reference/unity/mathematics/float2)): Angles in radians.

### Returns

| Type                                                                  | Description                                                 |
| --------------------------------------------------------------------- | ----------------------------------------------------------- |
| [float2](/engine/7000.0/script-reference/unity/mathematics/float2.md) | The componentwise equivalent angles in the range -PI to PI. |

### Remarks

Each component of the result is congruent to the input component modulo 2 \* PI and lies in the half-open range \[-PI, PI).

## unwind(float3)

Returns the componentwise angles of a float3 vector wrapped to the range -PI to PI.

```csharp
public static float3 unwind(float3 x)
```

### Parameters

**** (\[float3]\(/engine/7000.0/script-reference/unity/mathematics/float3)): Angles in radians.

### Returns

| Type                                                                  | Description                                                 |
| --------------------------------------------------------------------- | ----------------------------------------------------------- |
| [float3](/engine/7000.0/script-reference/unity/mathematics/float3.md) | The componentwise equivalent angles in the range -PI to PI. |

### Remarks

Each component of the result is congruent to the input component modulo 2 \* PI and lies in the half-open range \[-PI, PI).

## unwind(float4)

Returns the componentwise angles of a float4 vector wrapped to the range -PI to PI.

```csharp
public static float4 unwind(float4 x)
```

### Parameters

**** (\[float4]\(/engine/7000.0/script-reference/unity/mathematics/float4)): Angles in radians.

### Returns

| Type                                                                  | Description                                                 |
| --------------------------------------------------------------------- | ----------------------------------------------------------- |
| [float4](/engine/7000.0/script-reference/unity/mathematics/float4.md) | The componentwise equivalent angles in the range -PI to PI. |

### Remarks

Each component of the result is congruent to the input component modulo 2 \* PI and lies in the half-open range \[-PI, PI).

## unwind(double)

Returns the angle x wrapped to the range -PI to PI.

```csharp
public static double unwind(double x)
```

### Parameters

**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): Angle in radians.

### Returns

| Type                                                           | Description                                  |
| -------------------------------------------------------------- | -------------------------------------------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | The equivalent angle in the range -PI to PI. |

### Remarks

The result is congruent to x modulo 2 \* PI and lies in the half-open range \[-PI, PI).

## unwind(double2)

Returns the componentwise angles of a double2 vector wrapped to the range -PI to PI.

```csharp
public static double2 unwind(double2 x)
```

### Parameters

**** (\[double2]\(/engine/7000.0/script-reference/unity/mathematics/double2)): Angles in radians.

### Returns

| Type                                                                    | Description                                                 |
| ----------------------------------------------------------------------- | ----------------------------------------------------------- |
| [double2](/engine/7000.0/script-reference/unity/mathematics/double2.md) | The componentwise equivalent angles in the range -PI to PI. |

### Remarks

Each component of the result is congruent to the input component modulo 2 \* PI and lies in the half-open range \[-PI, PI).

## unwind(double3)

Returns the componentwise angles of a double3 vector wrapped to the range -PI to PI.

```csharp
public static double3 unwind(double3 x)
```

### Parameters

**** (\[double3]\(/engine/7000.0/script-reference/unity/mathematics/double3)): Angles in radians.

### Returns

| Type                                                                    | Description                                                 |
| ----------------------------------------------------------------------- | ----------------------------------------------------------- |
| [double3](/engine/7000.0/script-reference/unity/mathematics/double3.md) | The componentwise equivalent angles in the range -PI to PI. |

### Remarks

Each component of the result is congruent to the input component modulo 2 \* PI and lies in the half-open range \[-PI, PI).

## unwind(double4)

Returns the componentwise angles of a double4 vector wrapped to the range -PI to PI.

```csharp
public static double4 unwind(double4 x)
```

### Parameters

**** (\[double4]\(/engine/7000.0/script-reference/unity/mathematics/double4)): Angles in radians.

### Returns

| Type                                                                    | Description                                                 |
| ----------------------------------------------------------------------- | ----------------------------------------------------------- |
| [double4](/engine/7000.0/script-reference/unity/mathematics/double4.md) | The componentwise equivalent angles in the range -PI to PI. |

### Remarks

Each component of the result is congruent to the input component modulo 2 \* PI and lies in the half-open range \[-PI, PI).
