PHP acos() Function

Last Updated on May 24, 2021 by Roshan Parihar

PHP acos() Function returns the arc cosine of the given number in radians. It is the inverse or complimentary of the cos() function in PHP.

Syntax of PHP acos() Function


The function single argument to pass and find the arc cosine of a number.

Description of Parameters

Name Description
number Required. Specify the numeric value in the range -1 to 1 to find its arc cosine.

Examples and Uses



The above example shows the output as the floating-point numbers. When the function takes argument acos(-1), it gives output as the value of pi (π) that is ‘3.14’. The argument acos(1) gives output zero (0) as a result.

Also, when you give argument values below -1 and above 1, the function return not applicable (NAN) as the output showing above.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.