Example 1 — Basic asin() usage
This example finds the arc sine of a few well-known values and rounds the results.
<?php
echo asin(0) . PHP_EOL;
echo round(asin(0.5), 4) . PHP_EOL;
echo round(asin(1), 4) . PHP_EOL;
echo round(asin(-1), 4) . PHP_EOL; How It Works
- asin(0) returns 0 because the sine of 0 is 0.
- asin(0.5) is pi / 6, which rounds to 0.5236.
- asin(1) is pi / 2, which rounds to 1.5708.
- asin(-1) is -pi / 2, so the result is negative: -1.5708.

