JavaScript-wiskunde cosh ()

De JavaScript-functie Math.cosh () retourneert de cosinus hyperbolicus van een getal.

Het is gelijk aan (e x + e -x ) / 2 in wiskunde.

De syntaxis van de Math.cosh()functie is:

 Math.cosh(x)

cosh(), zijnde een statische methode, wordt aangeroepen met behulp van de Mathklassenaam.

Math.cosh () Parameters

De Math.cosh()functie neemt:

  • x - Een nummer

Retourwaarde van Math.cosh ()

  • Retourneert de cosinus hyperbolicus van het opgegeven getal.

Voorbeeld: Math.cosh () gebruiken

 // Math.cosh(x) is (e**(x) + e**(-x))/2 var num = Math.cosh(0); console.log(num); // 1 var num = Math.cosh(1); console.log(num); // 1.5430806348152437 var num = Math.cosh(-1); console.log(num); // 1.5430806348152437 var num = Math.cosh(2); console.log(num); // 3.7621956910836314

Uitvoer

 1 1,5430806348152437 1,5430806348152437 3,7621956910836314

Aanbevolen metingen:

  • JavaScript Math acosh ()
  • JavaScript Math sinh ()

Interessante artikelen...