Home >>Python math Module >Python math.acos() Method

Python math.acos() Method

Python math.acos() Method

Python math.acos() Method returns the arc cosine value (in radians) of the given number and it is used to get the arc cosine number between -1 to 1.

Syntax:
math.acos(x)

Parameter Values

Parameter Description
X It is Required a number to find the arc cosine of, in the range -1 to 1.
Here is an Example of Python math.acos() Method:

import math
print (math.acos(0.34))
print (math.acos(-0.23))
print (math.acos(1))
print (math.acos(0))
print (math.acos(-1))

Output:
1.2238794292677349
1.80287400965761
0.0
1.5707963267948966
3.141592653589793
Example 2:

import math
a = -1
print("acos(",a,") is = ", math.acos(a))
a = -1
print("acos(",a,") is = ", math.acos(a))
a = 0.256
print("acos(",a,") is = ", math.acos(a))
a = 1
print("acos(",a,") is = ", math.acos(a))

Output:
acos( -1 ) is = 3.141592653589793
acos( -1 ) is = 3.141592653589793
acos( 0.256 ) is = 1.3119142931291623
acos( 1 ) is = 0.0

No Sidebar ads