# ATAN2

**The function ATAN2 returns the arctan2 of given x and y coordinates.**

This function takes two [Numbers](../../variable-data-types/the-number-variable-data-type), call them x and y, as input. It returns another Number: the angle, in radians, between the positive x-axis and the ray to the point (x, y).&#x20;

#### Declaration

```javascript
ATAN2(x, y) -> arctangent
```

&#x20;

#### Parameters

**x** (required, type: `Number`) Any number; this represents the x-coordinate.

**y** (required, type: `Number`) Any number; this represents the y-coordinate.

#### Return Values

**arctangent** (type: `Number`) The angle, in radians, between the positive x-axis and the ray to the point (**x**, **y**).&#x20;

#### Examples

The following example returns the arctan2 of the coordinates (1, 1). Note that the angle between the positive x-axis and the ray to the point (1, 1) is forty-five degrees, or _0.25π_ radians, but the ATAN2 function doesn't output an angle in degrees or in radians in terms of pi. Rather, it provides a numerical estimation of the angle in radians:

```javascript
ATAN(1) -> 0.7853981633974483
```

To calculate the arctan2 in degrees, the ATAN2 function must be used in tandem with the [DEGREES](degrees) function, such as in the following example:

```javascript
DEGREES(ATAN2(1, 1)) -> 45
```

ATAN2 can also be used in tandem with the [PI](pi) function to provide insight into how the angle in radians relates to terms of pi, such as in the following example:

```javascript
ATAN2(1, 1)/PI() -> 0.25
```
