aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/javascript/reference/global_objects/math/cosh
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-11 12:36:08 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-11 12:36:08 +0100
commit39f2114f9797eb51994966c6bb8ff1814c9a4da8 (patch)
tree66dbd9c921f56e440f8816ed29ac23682a1ac4ef /files/fr/web/javascript/reference/global_objects/math/cosh
parent8260a606c143e6b55a467edf017a56bdcd6cba7e (diff)
downloadtranslated-content-39f2114f9797eb51994966c6bb8ff1814c9a4da8.tar.gz
translated-content-39f2114f9797eb51994966c6bb8ff1814c9a4da8.tar.bz2
translated-content-39f2114f9797eb51994966c6bb8ff1814c9a4da8.zip
unslug fr: move
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/math/cosh')
-rw-r--r--files/fr/web/javascript/reference/global_objects/math/cosh/index.html104
1 files changed, 104 insertions, 0 deletions
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
new file mode 100644
index 0000000000..99d12d6cf0
--- /dev/null
+++ b/files/fr/web/javascript/reference/global_objects/math/cosh/index.html
@@ -0,0 +1,104 @@
+---
+title: Math.cosh()
+slug: Web/JavaScript/Reference/Objets_globaux/Math/cosh
+tags:
+ - ECMAScript6
+ - JavaScript
+ - Math
+ - Méthode
+ - Reference
+ - polyfill
+translation_of: Web/JavaScript/Reference/Global_Objects/Math/cosh
+---
+<div>{{JSRef}}</div>
+
+<p>La fonction <code><strong>Math.cosh()</strong></code> renvoie le cosinus hyperbolique d'un nombre, défini par :</p>
+
+<p><math><semantics><mrow><mstyle mathvariant="monospace"><mo lspace="0em" rspace="thinmathspace">Math.cosh(x)</mo></mstyle><mo>=</mo><mfrac><mrow><msup><mi>e</mi><mi>x</mi></msup><mo>+</mo><msup><mi>e</mi><mrow><mo>-</mo><mi>x</mi></mrow></msup></mrow><mn>2</mn></mfrac></mrow><annotation encoding="TeX">\mathtt{\operatorname{Math.cosh(x)}} = \frac{e^x + e^{-x}}{2}</annotation></semantics></math></p>
+
+<div>{{EmbedInteractiveExample("pages/js/math-cosh.html")}}</div>
+
+<p class="hidden">Le code source de cet exemple interactif est disponible dans un dépôt GitHub. Si vous souhaitez contribuez à ces exemples, n'hésitez pas à cloner <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> et à envoyer une <em>pull request</em> !</p>
+
+<p>(Voir la page sur {{jsxref("Objets_globaux/Math/E","e","",1)}})</p>
+
+<h2 id="Syntaxe">Syntaxe</h2>
+
+<pre class="syntaxbox">Math.cosh(<var>x</var>)</pre>
+
+<h3 id="Paramètres">Paramètres</h3>
+
+<dl>
+ <dt><code>x</code></dt>
+ <dd>Un nombre.</dd>
+</dl>
+
+<h3 id="Valeur_de_retour">Valeur de retour</h3>
+
+<p>Le cosinus hyperbolique du nombre passé en argument.</p>
+
+<h2 id="Description">Description</h2>
+
+<p><code>cosh()</code> étant une méthode statique de <code>Math</code>, il faut utiliser <code>Math.cosh()</code> et non pas la méthode d'un objet <code>Math</code> créé sur mesure (<code>Math</code> n'est pas un constructeur).</p>
+
+<h2 id="Exemple">Exemple</h2>
+
+<h3 id="Utiliser_Math.cosh()">Utiliser <code>Math.cosh()</code></h3>
+
+<pre class="brush:js">Math.cosh(0); // 1
+Math.cosh(1); // 1.5430806348152437
+Math.cosh(-1); // 1.5430806348152437
+</pre>
+
+<h2 id="Prothèse_d'émulation_(polyfill)">Prothèse d'émulation (<em>polyfill</em>)</h2>
+
+<p>Cette fonction peut être émulée grâce à la fonction {{jsxref("Objets_globaux/Math/exp", "Math.exp()")}} :</p>
+
+<pre class="brush: js">Math.cosh = Math.cosh || function(x) {
+ return (Math.exp(x) + Math.exp(-x)) / 2;
+}</pre>
+
+<p>On peut également utiliser un unique appel à {{jsxref("Objets_globaux/Math/exp", "exp()")}} :</p>
+
+<pre class="brush: js">Math.cosh = Math.cosh || function(x) {
+ var y = Math.exp(x);
+ return (y + 1 / y) / 2;
+}</pre>
+
+<h2 id="Spécifications">Spécifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Spécification</th>
+ <th scope="col">État</th>
+ <th scope="col">Commentaires</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-math.cosh', 'Math.cosh')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>Définition initiale.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-math.cosh', 'Math.cosh')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+
+<p class="hidden">Le tableau de compatibilité de cette page a été généré à partir de données structurées. Si vous souhaitez contribuer à ces données, n'hésitez pas à envoyer une <em>pull request</em> sur <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>.</p>
+
+<p>{{Compat("javascript.builtins.Math.cosh")}}</p>
+
+<h2 id="Voir_aussi">Voir aussi</h2>
+
+<ul>
+ <li>{{jsxref("Math.acosh()")}}</li>
+ <li>{{jsxref("Math.asinh()")}}</li>
+ <li>{{jsxref("Math.atanh()")}}</li>
+ <li>{{jsxref("Math.sinh()")}}</li>
+ <li>{{jsxref("Math.tanh()")}}</li>
+</ul>