PHP asin() Function
In this chapter you will learn:
- Definition for PHP asin() Function
- Syntax for PHP asin() Function
- Parameter for PHP asin() Function
- Return for PHP asin() Function
- Example - calculate the arc sine value
Definition
The asin()
function calculates the arc sine value,
It reverses the operation of sine()
.
Syntax
PHP asin() Function has the following syntax.
float asin ( float num )
Parameter
Parameter | Is Required | Description |
---|---|---|
num | Required. | Specifies a number in range -1 to 1 |
Return
The return value is in radians.
We can use the rad2deg()
to convert radians to degrees.
asin(1)
returns the value of Pi/2
.
Example
Calculate the arc sine value
<?php/* ja va2s . c o m*/
$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.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP asinh() Function
- Syntax for PHP asinh() Function
- Parameter for PHP asinh() Function
- Return for PHP asinh() Function
- Example - Return the inverse hyperbolic sine of different numbers
Home » PHP Tutorial » PHP Math Functions