PHP - asin
Trieda
Metóda - asin
(PHP 4, PHP 5, PHP 7)
The asin() function returns a value of the goniometric function
arc sine. The arc sine is the complementary function of sine (often referred as
sin−1). It's used to get back the angle, which means, that
a == sin(asin(a)).
Procedurálne
- function asin (float $arg) : float
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $arg | float | The value of sine. |
Mávratovej hodnoty
Vracia: float
The resulting angle in radians.
Príklady
<?php
// each 15° till 180
for ($i = 0; $i <= 180; $i += 15) {
$sin = sin(deg2rad($i)); // converts the angle into radians and calculates its sine
$deg = rad2deg(asin($sin)); // calculates the angle in radians using the previous value and then converts it into degrees
echo("sin({$i}°) = $sin ---> asin($sin) = {$deg}°<br />");
}