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

PHP asin() Function

PHP asin() Function

PHP asin() function is used to find the arc sine value of a given input number in radians. The parameter passed in it should be a number in the range of -1 to 1. It accepts only a single parameter $number, which is the number whose arc sine value is to be found. It returns a floating point number as output which is the arc sine value of given input number passed as argument.

Syntax:

  asin($number);

Parameter Values

Parameter Description
number This is a required parameter. This parameter defines a number in the range of -1 to 1.

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

<html>
<body>

<?php

echo asin(0.55)."<br>";
echo asin(-0.55)."<br>";

?>

</body>
</html>
Output:
0.58236423786874
-0.58236423786874

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

<html>
<body>

<?php

echo asin(0)."<br>";
echo asin(1)."<br>";
echo asin(-1)."<br>";
echo asin(2);  // value should be in the range of -1 to 1.

?>

</body>
</html>
Output:
0
1.5707963267949
-1.5707963267949
NAN

No Sidebar ads