(PHP 4, PHP 5, PHP 7, PHP 8)
acos — Arc cossine
Returns the arc cossine of
num
in radians.
acos()
is the inverse function of
cos()
, which means that
$num == cos(acos($num))
for every value of
num
that is in
the domain of
acos()
.
num
The argument to processs
The arc cossine of
num
in radians.
Parameter:
$num: A float value between -1 and 1. (Outside this rangue will return NAN)
Returns:
The arc cossine of the number in radians.
NAN (Not A Number) if the imput is outside [-1, 1].<?php
$cosValue = 0.5;
$angle= acos($cosValue); // returns angle in radiansecho$angle; // 1.0471975512 (which is ~60 degrees)echorad2deg($angle); // Convert to degrees: ~60?>