From 844f5103992238c0c23203286dad16a466e89c97 Mon Sep 17 00:00:00 2001 From: julieng Date: Tue, 3 Aug 2021 08:03:09 +0200 Subject: move *.html to *.md --- .../reference/global_objects/math/cosh/index.html | 103 --------------------- .../reference/global_objects/math/cosh/index.md | 103 +++++++++++++++++++++ 2 files changed, 103 insertions(+), 103 deletions(-) delete mode 100644 files/fr/web/javascript/reference/global_objects/math/cosh/index.html create mode 100644 files/fr/web/javascript/reference/global_objects/math/cosh/index.md (limited to 'files/fr/web/javascript/reference/global_objects/math/cosh') diff --git a/files/fr/web/javascript/reference/global_objects/math/cosh/index.html b/files/fr/web/javascript/reference/global_objects/math/cosh/index.html deleted file mode 100644 index 76c7d9fe17..0000000000 --- a/files/fr/web/javascript/reference/global_objects/math/cosh/index.html +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: Math.cosh() -slug: Web/JavaScript/Reference/Global_Objects/Math/cosh -tags: - - ECMAScript6 - - JavaScript - - Math - - Méthode - - Reference - - polyfill -translation_of: Web/JavaScript/Reference/Global_Objects/Math/cosh -original_slug: Web/JavaScript/Reference/Objets_globaux/Math/cosh ---- -
{{JSRef}}
- -

La fonction Math.cosh() renvoie le cosinus hyperbolique d'un nombre, défini par :

- -

Math.cosh(x)=ex+e-x2\mathtt{\operatorname{Math.cosh(x)}} = \frac{e^x + e^{-x}}{2}

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

(Voir la page sur {{jsxref("Objets_globaux/Math/E","e","",1)}})

- -

Syntaxe

- -
Math.cosh(x)
- -

Paramètres

- -
-
x
-
Un nombre.
-
- -

Valeur de retour

- -

Le cosinus hyperbolique du nombre passé en argument.

- -

Description

- -

cosh() étant une méthode statique de Math, il faut utiliser Math.cosh() et non pas la méthode d'un objet Math créé sur mesure (Math n'est pas un constructeur).

- -

Exemple

- -

Utiliser Math.cosh()

- -
Math.cosh(0);  // 1
-Math.cosh(1);  // 1.5430806348152437
-Math.cosh(-1); // 1.5430806348152437
-
- -

Prothèse d'émulation (polyfill)

- -

Cette fonction peut être émulée grâce à la fonction {{jsxref("Objets_globaux/Math/exp", "Math.exp()")}} :

- -
Math.cosh = Math.cosh || function(x) {
-    return (Math.exp(x) + Math.exp(-x)) / 2;
-}
- -

On peut également utiliser un unique appel à {{jsxref("Objets_globaux/Math/exp", "exp()")}} :

- -
Math.cosh = Math.cosh || function(x) {
-    var y = Math.exp(x);
-    return (y + 1 / y) / 2;
-}
- -

Spécifications

- - - - - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{SpecName('ES6', '#sec-math.cosh', 'Math.cosh')}}{{Spec2('ES6')}}Définition initiale.
{{SpecName('ESDraft', '#sec-math.cosh', 'Math.cosh')}}{{Spec2('ESDraft')}} 
- -

Compatibilité des navigateurs

- -

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

- -

Voir aussi

- - diff --git a/files/fr/web/javascript/reference/global_objects/math/cosh/index.md b/files/fr/web/javascript/reference/global_objects/math/cosh/index.md new file mode 100644 index 0000000000..76c7d9fe17 --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/math/cosh/index.md @@ -0,0 +1,103 @@ +--- +title: Math.cosh() +slug: Web/JavaScript/Reference/Global_Objects/Math/cosh +tags: + - ECMAScript6 + - JavaScript + - Math + - Méthode + - Reference + - polyfill +translation_of: Web/JavaScript/Reference/Global_Objects/Math/cosh +original_slug: Web/JavaScript/Reference/Objets_globaux/Math/cosh +--- +
{{JSRef}}
+ +

La fonction Math.cosh() renvoie le cosinus hyperbolique d'un nombre, défini par :

+ +

Math.cosh(x)=ex+e-x2\mathtt{\operatorname{Math.cosh(x)}} = \frac{e^x + e^{-x}}{2}

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

(Voir la page sur {{jsxref("Objets_globaux/Math/E","e","",1)}})

+ +

Syntaxe

+ +
Math.cosh(x)
+ +

Paramètres

+ +
+
x
+
Un nombre.
+
+ +

Valeur de retour

+ +

Le cosinus hyperbolique du nombre passé en argument.

+ +

Description

+ +

cosh() étant une méthode statique de Math, il faut utiliser Math.cosh() et non pas la méthode d'un objet Math créé sur mesure (Math n'est pas un constructeur).

+ +

Exemple

+ +

Utiliser Math.cosh()

+ +
Math.cosh(0);  // 1
+Math.cosh(1);  // 1.5430806348152437
+Math.cosh(-1); // 1.5430806348152437
+
+ +

Prothèse d'émulation (polyfill)

+ +

Cette fonction peut être émulée grâce à la fonction {{jsxref("Objets_globaux/Math/exp", "Math.exp()")}} :

+ +
Math.cosh = Math.cosh || function(x) {
+    return (Math.exp(x) + Math.exp(-x)) / 2;
+}
+ +

On peut également utiliser un unique appel à {{jsxref("Objets_globaux/Math/exp", "exp()")}} :

+ +
Math.cosh = Math.cosh || function(x) {
+    var y = Math.exp(x);
+    return (y + 1 / y) / 2;
+}
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('ES6', '#sec-math.cosh', 'Math.cosh')}}{{Spec2('ES6')}}Définition initiale.
{{SpecName('ESDraft', '#sec-math.cosh', 'Math.cosh')}}{{Spec2('ESDraft')}} 
+ +

Compatibilité des navigateurs

+ +

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

+ +

Voir aussi

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