ATN2() Function in SQL Server

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 :


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

SELECT ATN2(-2.53, -5.6);

Output :


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


Output :

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.