# atan2

> Returns the 2-argument arctangent of a pair of float values.

## Definition

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

## atan2(float, float)

Returns the 2-argument arctangent of a pair of float values.

```csharp
public static float atan2(float y, float x)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Numerator of the ratio y/x, usually the y component on the unit circle.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Denominator of the ratio y/x, usually the x component on the unit circle.

### Returns

| Type                                                          | Description                                  |
| ------------------------------------------------------------- | -------------------------------------------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The arctangent of the ratio y/x, in radians. |

## atan2(float2, float2)

Returns the componentwise 2-argument arctangent of a pair of floats2 vectors.

```csharp
public static float2 atan2(float2 y, float2 x)
```

### Parameters

**** (\[float2]\(/engine/6000.7/script-reference/unity/mathematics/float2)): Numerator of the ratio y/x, usually the y component on the unit circle.**** (\[float2]\(/engine/6000.7/script-reference/unity/mathematics/float2)): Denominator of the ratio y/x, usually the x component on the unit circle.

### Returns

| Type                                                                  | Description                                                |
| --------------------------------------------------------------------- | ---------------------------------------------------------- |
| [float2](/engine/6000.7/script-reference/unity/mathematics/float2.md) | The componentwise arctangent of the ratio y/x, in radians. |

## atan2(float3, float3)

Returns the componentwise 2-argument arctangent of a pair of floats3 vectors.

```csharp
public static float3 atan2(float3 y, float3 x)
```

### Parameters

**** (\[float3]\(/engine/6000.7/script-reference/unity/mathematics/float3)): Numerator of the ratio y/x, usually the y component on the unit circle.**** (\[float3]\(/engine/6000.7/script-reference/unity/mathematics/float3)): Denominator of the ratio y/x, usually the x component on the unit circle.

### Returns

| Type                                                                  | Description                                                |
| --------------------------------------------------------------------- | ---------------------------------------------------------- |
| [float3](/engine/6000.7/script-reference/unity/mathematics/float3.md) | The componentwise arctangent of the ratio y/x, in radians. |

## atan2(float4, float4)

Returns the componentwise 2-argument arctangent of a pair of floats4 vectors.

```csharp
public static float4 atan2(float4 y, float4 x)
```

### Parameters

**** (\[float4]\(/engine/6000.7/script-reference/unity/mathematics/float4)): Numerator of the ratio y/x, usually the y component on the unit circle.**** (\[float4]\(/engine/6000.7/script-reference/unity/mathematics/float4)): Denominator of the ratio y/x, usually the x component on the unit circle.

### Returns

| Type                                                                  | Description                                                |
| --------------------------------------------------------------------- | ---------------------------------------------------------- |
| [float4](/engine/6000.7/script-reference/unity/mathematics/float4.md) | The componentwise arctangent of the ratio y/x, in radians. |

## atan2(double, double)

Returns the 2-argument arctangent of a pair of double values.

```csharp
public static double atan2(double y, double x)
```

### Parameters

**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): Numerator of the ratio y/x, usually the y component on the unit circle.**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): Denominator of the ratio y/x, usually the x component on the unit circle.

### Returns

| Type                                                           | Description                                  |
| -------------------------------------------------------------- | -------------------------------------------- |
| [double](https://learn.microsoft.com/dotnet/api/system.double) | The arctangent of the ratio y/x, in radians. |

## atan2(double2, double2)

Returns the 2-argument arctangent of a pair of double2 vectors.

```csharp
public static double2 atan2(double2 y, double2 x)
```

### Parameters

**** (\[double2]\(/engine/6000.7/script-reference/unity/mathematics/double2)): Numerator of the ratio y/x, usually the y component on the unit circle.**** (\[double2]\(/engine/6000.7/script-reference/unity/mathematics/double2)): Denominator of the ratio y/x, usually the x component on the unit circle.

### Returns

| Type                                                                    | Description                                                |
| ----------------------------------------------------------------------- | ---------------------------------------------------------- |
| [double2](/engine/6000.7/script-reference/unity/mathematics/double2.md) | The componentwise arctangent of the ratio y/x, in radians. |

## atan2(double3, double3)

Returns the 2-argument arctangent of a pair of double3 vectors.

```csharp
public static double3 atan2(double3 y, double3 x)
```

### Parameters

**** (\[double3]\(/engine/6000.7/script-reference/unity/mathematics/double3)): Numerator of the ratio y/x, usually the y component on the unit circle.**** (\[double3]\(/engine/6000.7/script-reference/unity/mathematics/double3)): Denominator of the ratio y/x, usually the x component on the unit circle.

### Returns

| Type                                                                    | Description                                                |
| ----------------------------------------------------------------------- | ---------------------------------------------------------- |
| [double3](/engine/6000.7/script-reference/unity/mathematics/double3.md) | The componentwise arctangent of the ratio y/x, in radians. |

## atan2(double4, double4)

Returns the 2-argument arctangent of a pair of double4 vectors.

```csharp
public static double4 atan2(double4 y, double4 x)
```

### Parameters

**** (\[double4]\(/engine/6000.7/script-reference/unity/mathematics/double4)): Numerator of the ratio y/x, usually the y component on the unit circle.**** (\[double4]\(/engine/6000.7/script-reference/unity/mathematics/double4)): Denominator of the ratio y/x, usually the x component on the unit circle.

### Returns

| Type                                                                    | Description                                                |
| ----------------------------------------------------------------------- | ---------------------------------------------------------- |
| [double4](/engine/6000.7/script-reference/unity/mathematics/double4.md) | The componentwise arctangent of the ratio y/x, in radians. |
