PHP function acos – Arc cosine

Description

The acos() function calculates the arc cosine value of the number provided as its only parameter, essentially reversing the operation of cos(). The return value is in radians—you should use the rad2deg() to convert radians to degrees.

$acos1 = acos(0.4346);
$acos2 = acos(cos(80));

Syntax:

acos(float $num): float

Parameters

Parameter Description
num The argument to process

Return Values

The arc cosine of num in radians.

Example

Calculate the arccosine of a value

$cos = 0.5; 
echo "The arccosine of $cos is ", acos($cos); 
Related Post