Home >>PHP Math Functions >PHP cosh() Function

PHP cosh() Function

PHP cosh() Function

PHP cosh() function is used to find the hyperbolic sine of the given input angle. It accepts only a single parameter $number which is the number whose hyperbolic cosine value is to be found. Its value must be in radians. It returns a floating point number as output which is the hyperbolic cosine value of the given input number passed as argument.

Syntax:

  cosh($number);

Parameter Values

Parameter Description
number This is a required parameter. This parameter defines the given input number.

Here is an example of cosh() function in PHP:

<html>
<body>

<?php

echo cosh(1)."<br>";
echo cosh(-1)."<br>";

?>

</body>
</html>
Output:
1.5430806348152
1.5430806348152

Here is an another example of cosh() function in PHP:

<html>
<body>

<?php
$pi = M_PI;  // M_PI is the value of PI(22/7)

echo cosh(0)."<br>";
echo cosh($pi/3)."<br>";
echo cosh($pi/4)."<br>";
echo cosh($pi)."<br>";
echo cosh(2*$pi)."<br>";

?>

</body>
</html>
Output:
1
1.6002868577024
1.324609089252
11.591953275522
267.74676148375