The asin()
function calculates the arc sine value,
It reverses the operation of sine()
.
PHP asin() Function has the following syntax.
float asin ( float num )
Parameter | Is Required | Description |
---|---|---|
num | Required. | Specifies a number in range -1 to 1 |
The return value is in radians.
We can use the rad2deg()
to convert radians to degrees.
asin(1)
returns the value of Pi/2
.
Calculate the arc sine value
<?php// www . j av a2 s.c om
$asin1 = asin(0.46);
print($asin1);
$asin2 = asin(sin(8));
print($asin2);
echo(asin(0.4) . "\n");
echo(asin(-0.4) . "\n");
echo(asin(0) . "\n");
echo(asin(-1) . "\n");
echo(asin(1) . "\n");
echo(asin(2));
?>
The code above generates the following result.