Latest web development tutorials

PHP acos () function

PHP Math Reference PHP Math Reference

Examples

Returns the inverse cosine different numbers:

<?php
echo(acos(0.64) . "<br>");
echo(acos(-0.4) . "<br>");
echo(acos(0) . "<br>");
echo(acos(-1) . "<br>");
echo(acos(1) . "<br>");
echo(acos(2));
?>

Running instance »

Definition and Usage

acos () function returns the inverse cosine of a number.

Tip: acos (-1) returns the value of Pi.


grammar

acos( number );

参数 描述
number 必需。规定一个数,范围在 -1 到 1 之间。

technical details

return value: number of inverse cosine. If the number is not in the range between -1 and 1, then return to NAN.
Return type: Float
PHP version: 4+


PHP Math Reference PHP Math Reference