From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- .../reference/global_objects/math/tan/index.html | 101 +++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 files/fr/web/javascript/reference/global_objects/math/tan/index.html (limited to 'files/fr/web/javascript/reference/global_objects/math/tan/index.html') diff --git a/files/fr/web/javascript/reference/global_objects/math/tan/index.html b/files/fr/web/javascript/reference/global_objects/math/tan/index.html new file mode 100644 index 0000000000..948ea10a14 --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/math/tan/index.html @@ -0,0 +1,101 @@ +--- +title: Math.tan() +slug: Web/JavaScript/Reference/Objets_globaux/Math/tan +tags: + - JavaScript + - Math + - Méthode + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Math/tan +--- +
{{JSRef}}
+ +

La fonction Math.tan() renvoie la tangente d'un nombre exprimant un angle en radians.

+ +
{{EmbedInteractiveExample("pages/js/math-tan.html")}}
+ + + +

Syntaxe

+ +
Math.tan(x)
+ +

Paramètres

+ +
+
x
+
Un nombre qui représente un angle en radians.
+
+ +

Valeur de retour

+ +

La tangente de l'angle fourni en argument (exprimé en radians).

+ +

Description

+ +

La méthode Math.tan() renvoie une valeur numérique qui représente la tangente d'un angle.

+ +

tan() est une méthode statique de Math et doit toujours être utilisée avec la syntaxe Math.tan(), elle ne doit pas être utilisée comme méthode d'un autre objet qui aurait été créé (Math n'est pas un constructeur).

+ +

Exemples

+ +

Utiliser Math.tan()

+ +
Math.tan(1); // 1.5574077246549023
+ +

Math.tan() considère un argument exprimé en radians. Cependant, on peut vouloir travailler avec des valeurs en degrés. Pour cela, on pourra utiliser la fonction suivante qui calcule la tangente après avoir converti l'argument en radians :

+ +
function getTanDeg(deg) {
+   var rad = deg * Math.PI/180;
+   return Math.tan(rad);
+}
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('ES1')}}{{Spec2('ES1')}}Définition initiale. Implémentée avec JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.8.2.18', 'Math.tan')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-math.tan', 'Math.tan')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-math.tan', 'Math.tan')}}{{Spec2('ESDraft')}} 
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("javascript.builtins.Math.tan")}}

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf