Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP acos() Function

PHP acos() Function

PHP Math Reference Manual PHP Math Reference Manual

Example

Return the arc cosine of different numbers:

"); echo(acos(-0.4) . "
"); echo(acos(0) . "
"); echo(acos(-1) . "
"); echo(acos(1) . "
"); echo(acos(2)); ?>

Run Example »


Definition and Usage

The acos() function returns the arc cosine of a number.

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


Syntax

acos(

number

);

Parameters Description
number Required. Specifies a number in the range -1 to 1.

Technical Details

Return Value: number The arc cosine of. If number is not in the range -1 to 1, NAN is returned.
Return Type: Float
PHP Version: 4+

PHP Math Reference Manual PHP Math Reference Manual