PHP: acos() function
Description
The acos() function returns the arc cosine of a number in radians.
Version:
(PHP 4 and above)
Syntax:
acos(number)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
number | Numeric value. | Required | Float |
Return value:
The arc cosine of a number.
Value Type: Float.
Example:
<?php
$val1= 0;
$val2 = .4;
$val3 = 1;
$val4 = 2;
$zacos1=acos($val1);
$zacos2=acos($val2);
$zacos3=acos($val3);
$zacos4=acos($val4);
echo "Arc cosine of $val1 is $abs1<br />";
echo "Arc cosine of $val2 is $abs1<br />";
echo "Arc cosine of $val3 is $abs1<br />";
echo "Arc cosine of $val4 is $abs1<br />";
?>
Sample Output:
Arc cosine of 0 is 1.5707963267949 Arc cosine of 0.4 is 1.1592794807274 Arc cosine of 1 is 0 Arc cosine of 2 is NAN
View the example in the browser
Pictorial Presentation :
See also
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics