Méthode math.atan() de Python

Python math 模块Module math de Python

Python math.atan(x)Renvoie l'arc tangente de x, en radians, le résultat allant de -pi/2 à pi/2.

Version Python : 1.6.1

Syntaxe

La syntaxe de math.atan() est la suivante :

math.atan(x)

Description des paramètres :

  • x-- Obligatoire, un nombre positif ou négatif. Si x n'est pas un nombre, renvoie TypeError.

Valeur de retour

Renvoie un nombre à virgule flottante représentant l'arc tangente d'un nombre, dans l'intervalle -pi/2 à pi/2.

Exemple

L'exemple suivant renvoie l'arc tangente de différents nombres :

Exemple

# Importer le package math
import math

# Affiche la valeur de l'arc tangente
print (math.atan(0.39))
print (math.atan(67))
print (math.atan(-21))

Résultat de sortie :

0.37185607384858127
1.5558720618048116
-1.5232132235179132

Python math 模块Module math de Python

Autres extensions