Python – atan2() Function – Examples & Explanation

atan2() function is used to find the atan(y / x) in Python for the given input(x – parameter).

 

Syntax of atan2() Function

The syntax of atan2() function in Python is:

 

Parameters of atan2() Function in Python

x – Where x is any valid python number (positive or negative). This parameter is required.
Note: If the x parameter is not a number, atan2() function will return an Error.

 

Compatibility

atan2() function is available and compatible with both Python 2.x and 3.x. This function is a part of python standard math library.

 

Return Value of atan2() Function in Python

atan2() function returns atan(y / x) for the given input.

 

Python atan2() Function Example


Output: