Python - cmath.atan() Function
The Python cmath.atan() function is used to return arc tangent of a complex number. There are two branch cuts:
- Extends from 1j along the imaginary axis to ∞j, continuous from the right.
- Extends from -1j along the imaginary axis to -∞j, continuous from the left.
Syntax
cmath.atan(x)
Parameters
x |
Required. Specify the value. |
Return Value
Returns the arc tangent of the value.
Example:
In the below example, atan() function is used to find out the arc tangent of a given complex number.
import cmath x = 2 + 2j y = 2 z = 2j print(cmath.atan(x)) print(cmath.atan(y)) print(cmath.atan(z))
The output of the above code will be:
(1.311223269671635+0.23887786125685911j) (1.1071487177940904+0j) (1.5707963267948966+0.5493061443340549j)
❮ Python cMath Module