Home >>PHP Math Functions >PHP tanh() Function
PHP tanh() function is used to find the hyperbolic tangent of an given input angle passed to it as a parameter. The hyperbolic tangent of any argument X is equal to “sinh(X) / cosh(X)”. It accepts only a single parameter $number which is the given number whose hyperbolic tangent value is to be found. Its parameter value must be in radians.
Syntax:
tanh($number);
Parameter | Description |
---|---|
number | This is a required parameter. This parameter defines the given input argument. |
Here is an example of tanh() function in PHP:
<html> <body> <?php echo tanh(0)."<br>"; echo tanh(1)."<br>"; echo tanh(1.5)."<br>"; echo tanh(-1)."<br>"; ?> </body> </html>
Here is another example of tanh() function in PHP:
<html> <body> <?php echo tanh(0)."<br>"; echo tanh(pi()/6)."<br>"; echo tanh(pi()/4)."<br>"; echo tanh(pi()/3)."<br>"; ?> </body> </html>