Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python math.atan() Method

Python math.atan() Method

Python math Module Python math Module

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:

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

print

(

math

.

atan

(

0.39

)

)

print

(

math

.

atan

(

67

)

)

print

(

math

.

atan

(

21

)

)

Output result:


0.37185607384858127
1.5558720618048116
-1.5232132235179132

Python math Module Python math Module