unwind
Returns the angle x wrapped to the range -PI to PI.
Read time 3 minutesLast updated 5 days ago
Definition
- Type: Method
- Namespace: Unity.Mathematics
- Assembly: UnityEngine.MathematicsModule
unwind(float)
Returns the angle x wrapped to the range -PI to PI.
public static float unwind(float x)
Parameters
Angle in radians.
Returns
Type | Description |
|---|---|
| float | 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.
public static float2 unwind(float2 x)
Parameters
Angles in radians.
Returns
Type | Description |
|---|---|
| float2 | 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.
public static float3 unwind(float3 x)
Parameters
Angles in radians.
Returns
Type | Description |
|---|---|
| float3 | 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.
public static float4 unwind(float4 x)
Parameters
Angles in radians.
Returns
Type | Description |
|---|---|
| float4 | 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.
public static double unwind(double x)
Parameters
Angle in radians.
Returns
Type | Description |
|---|---|
| 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.
public static double2 unwind(double2 x)
Parameters
Angles in radians.
Returns
Type | Description |
|---|---|
| double2 | 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.
public static double3 unwind(double3 x)
Parameters
Angles in radians.
Returns
Type | Description |
|---|---|
| double3 | 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.
public static double4 unwind(double4 x)
Parameters
Angles in radians.
Returns
Type | Description |
|---|---|
| double4 | 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).