PHP | cosh( ) Function
The cosh() function is a builtin function in PHP and is used to find the hyperbolic sine of an angle.
The hyperbolic cosine of any argument arg is defined as,
(exp(arg) + exp(-arg))/2
Where, exp() is the exponential function and returns e raised to the power of argument passed to it. For example exp(2) = e^2.
Syntax:
float cosh($value)
Parameters:This function accepts a single parameter $value. It is the number whose hyperbolic cosine value you want to find. The value of this parameter must be in radians.
Return Value: It returns a floating point number which is the hyperbolic cosine value of number passed to it as argument.
Examples:
Input : cosh(3) Output : 10.067661995778 Input : cosh(-3) Output : 10.067661995778 Input : cosh(2*M_PI) Output : 267.74676148375 Input : cosh(0) Output : 1
Below programs taking different values of $value are used to illustrate the cosh() function in PHP:
- Passing 3 as a parameter:
<?phpecho(cosh(3));?>chevron_rightfilter_noneOutput:
10.067661995778
- Passing -3 as a parameter:
<?phpecho(cosh(-3));?>chevron_rightfilter_noneOutput:
10.067661995778
- When (2*M_PI) is passed as a parameter, M_PI is a constant in PHP whose value is 3.1415926535898:
<?phpecho(cosh(2*M_PI));?>chevron_rightfilter_noneOutput:
267.74676148375
- Passing 0 as a parameter:
<?phpecho(cosh(0));?>chevron_rightfilter_noneOutput:
1
Reference:
http://php.net/manual/en/function.cosh.php
Recommended Posts:
- How to call a function that return another function in JavaScript ?
- How to get the function name inside a function in PHP ?
- How to get the function name from within that function using JavaScript ?
- p5.js | arc() Function
- PHP | cos( ) Function
- p5.js | int() function
- PHP | tan( ) Function
- PHP | sin( ) Function
- D3.js | d3.hsl() Function
- PHP | Ds\Map put() Function
- CSS | var() Function
- PHP Ds\Set sum() Function
- p5.js | sin() function
- p5.js | tan() function
- PHP | Ds\Set last() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



