PHP asinh() Function

PHPServer Side ProgrammingProgramming

Definition and Usage

The asinh() function calculates inverse of hyperbolic sine of given parameter. In other words, the return value of asinh() is hyperbolic sine of given parameter. A inverse hyperbolic sine function is defined as

asinh(x) = log(x+sqrt(pow(x,2)+1))

This function returns a float value.

Syntax

asinh( float $arg ) : float

Parameters

Sr.NoParameter & Description
1arg
A floating point value whose inverse hyperbolic sine is to be calculated

Return Values

PHP asinh() function returns inverse hyperbolic sine ratio of given parameter.

PHP Version

This function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.

Example

 Live Demo

Following example calculates asinh(pi/2) which we can verify using the definition −

<?php
   $arg=M_PI_2;
   $val=asinh($arg);
   $ret=log($arg+sqrt(pow($arg,2)+1));
   echo "asinh(" . $arg . ") = " . $val . "\n";
   echo "using formula = " . $ret;
?>

Output

This will produce following result −

asinh(1.5707963267949) = 1.2334031175112
using formula = 1.2334031175112

Example

 Live Demo

Following example uses deg2rad() function to convert degrees to radians and then uses asinh(30) −

<?php
   $arg=deg2rad(30);
   $val=asinh($arg);
   echo "asinh(" . $arg . ") = " . $val;
?>

Output

This will produce following result −

asinh(0.5235987755983) = 0.50221898503461

Example

 Live Demo

Let's check find out asinh(0). It returns 0 −

<?php
   $arg=0;
   $val=asinh($arg);
   echo "asinh(" . $arg . ") = " . $val;
?>

Output

This will produce following result −

asinh(0) = 0

Example

 Live Demo

Following example computes asinh(pi)

<?php
   $arg=M_PI; // pi
   $val=asinh($arg);
   echo "asinh(" . $arg . ") = " . $val;
?>

Output

This will produce following result −

asinh(3.1415926535898) = 1.8622957433108
raja
Published on 29-Jun-2020 11:52:30
Advertisements