English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The acos() function returns the inverse cosine of the number. It specifies-1to1range, if num is not within-1to1is within the range, it returns NaN.
acos(num)
num-the number for which the inverse cosine is to be returned.-1to1between the numbers.
The acos() function returns the inverse cosine value of the specified number.
If the number is not within-1to1is within the range, it is NaN.
<?php echo(acos(0.50) . "; echo(acos(-0.90) . "; ?>
Output Result
1.0471975511966<br>2.6905658417935<br>
Let's see another example-
<?php echo(acos(0) . "; echo(acos(1) . "; echo(acos(-1) . "; echo(acos(2) . "; ?>
Output Result
1.5707963267949<br>0<br>3.1415926535898<br>NAN<br>