Javatpoint Logo
Javatpoint Logo

PHP math acos() function

The acos() function is useful predefined PHP function to calculate trigonometry problem. It is used to find the arc cosine of a number in radians.

Note: acos(-1) returns the value of Pi.

Syntax:

Parameter Description Required/Optional
Number Specify a number in range -1 to 1. Required

Example1

Output:

Your number is :0
By using 'acos()' function your number is :1.5707963267949

Example2

Output:

Your number is :1
By using 'acos()' function your number is :0

Example3

Output:

Your number is :2
By using 'acos()' function your number is :NAN
Note : Your number is outside the range [-1,1]

Example4

Output:

Your number is :0.64
By using 'acos()' function your number is :0.87629806116834

Example5

Output:

Your number is :-0.4
By using 'acos()' function your number is :1.9823131728624

Example6

Output:

Your number is :-1
By using 'acos()' function your number is :3.1415926535898

Next TopicPHP Math





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA