Python Tutorial Python Advanced Python References Python Libraries

Python math - atan() Function



The Python math.atan() function returns arc tangent of a value. The return value will be in the range -𝜋/2 through 𝜋/2.

Note: atan() is the inverse of tan().

Syntax

math.atan(x)

Parameters

x Required. Specify the value.

Return Value

Returns the arc tangent of the value.

Example:

In the example below, atan() function is used to find out the arc tangent of a given value.

import math

print(math.atan(0.5))
print(math.atan(1))
print(math.atan(-0.5))
print(math.atan(-1))

The output of the above code will be:

0.4636476090008061
0.7853981633974483
-0.4636476090008061
-0.7853981633974483

❮ Python Math Module

5