acos
(PHP 4, PHP 5)
acos — Arc cosine
Description
float acos
( float
$arg
)
Returns the arc cosine of arg
in radians.
acos() is the complementary function of
cos(), which means that
a==cos(acos(a)) for every value of a that is within
acos()' range.
Parameters
-
arg
-
The argument to process
Return Values
The arc cosine of arg
in radians.
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Математические расширения
- Математические функции
- abs
- acos
- acosh
- asin
- asinh
- atan2
- atan
- atanh
- base_convert
- bindec
- ceil
- cos
- cosh
- decbin
- dechex
- decoct
- deg2rad
- exp
- expm1
- floor
- fmod
- getrandmax
- hexdec
- hypot
- intdiv
- is_finite
- is_infinite
- is_nan
- lcg_value
- log10
- log1p
- log
- max
- min
- mt_getrandmax
- mt_rand
- mt_srand
- octdec
- pi
- pow
- rad2deg
- rand
- round
- sin
- sinh
- sqrt
- srand
- tan
- tanh
Коментарии
Parameter:
$num: A float value between -1 and 1. (Outside this range will return NAN)
Returns:
The arc cosine of the number in radians.
NAN (Not A Number) if the input is outside [-1, 1].
<?php
$cosValue = 0.5;
$angle = acos($cosValue); // returns angle in radians
echo $angle; // 1.0471975512 (which is ~60 degrees)
echo rad2deg($angle); // Convert to degrees: ~60
?>