Related Articles
ATN2() Function in SQL Server
• Last Updated : 29 Sep, 2020

In this article, we are going to cover the ATN2()function in which we will see how we can get the arc tangent of two given numbers. Let’s discuss one by one.

```// here val1 and val2 are input.
Input  : ATN2(val1, val2)
Output : Arc tangent result.
```

ATN2() :
It is the function that returns the arc tangent of two numbers.

Syntax :

```ATN2(val1, val2)
```

Parameter :
This method accepts two-parameters as mentioned above and described below.

• val1, val2:
It is the two numeric values to calculate the arc tangent.

Returns –
It returns the arc tangent of two numbers.

Example-1 :
When the arguments hold the positive number.

```SELECT ATN2(2.53, 5.6);
```

Output :

```0.42433793483800258
```

Example-2 :
When the arguments hold the negative number.

```SELECT ATN2(-2.53, -5.6);
```

Output :

```-2.7172547187517906
```

Example-3 :
When the PI() function passing one of the arguments.

```SELECT ATN2(PI(), 4);
```

Output :

```0.66577375002835382
```
My Personal Notes arrow_drop_up