Python math.atan() Method
Python math.atan(x) Returns the arctangent of x in radians, with the result in the range -pi/2 to pi/2.
Python version: 1.6.1
Syntax
The syntax of the math.atan() method is as follows:
math.atan(x)
Parameter Description:
- x -- required, a positive or negative number. If x is not a number, a TypeError is returned.
Return Value
Returns a floating-point number representing the arctangent of a number, in the range -pi/2 to pi/2.
Example
The following example returns the arctangent of different numbers:
Example
Import the math package
import
math
Output the arctangent values
(
math
.
atan
(
0.39
)
)
(
math
.
atan
(
67
)
)
(
math
.
atan
(
21
)
)
Output result:
0.37185607384858127
1.5558720618048116
-1.5232132235179132
Python math Module