JavaScript Math tanh ()

La fonction JavaScript Math.tanh () renvoie la tangente hyperbolique d'un nombre.

C'est équivalent à (e x - e -x ) / (e x + e -x ) en mathématiques.

La syntaxe de la Math.tanh()fonction est:

 Math.tanh(x)

tanh(), étant une méthode statique, est appelée en utilisant le Mathnom de la classe.

Paramètres Math.tanh ()

La Math.tanh()fonction prend en charge:

  • x - Un nombre

Valeur renvoyée par Math.tanh ()

  • Renvoie la tangente hyperbolique du nombre donné.

Exemple: Utilisation de Math.tanh ()

 // Math.tanh(x) is (e**(x) - e**(-x))/(e**(x) + e**(-x)) var num = Math.tanh(0); console.log(num); // 0 var num = Math.tanh(1); console.log(num); // 0.7615941559557649 var num = Math.tanh(-1); console.log(num); // -0.7615941559557649 var num = Math.tanh(2); console.log(num); // 0.9640275800758169

Production

 0 0,7615941559557649 -0,7615941559557649 0,9640275800758169

Lectures recommandées:

  • JavaScript Math atanh ()
  • JavaScript Math sinh ()

Articles intéressants...