Python acos () function
description
acos () returns the inverse cosine of x radians.
grammar
The following is the syntax acos () method:
import math math.acos(x)
Note: acos () is not directly accessible, you need to import math module, and then call the method by math static objects.
parameter
- x - values between -1 and 1. If x is greater than 1, it will generate an error.
return value
Returns the arc cosine of x in radians.
Examples
The following illustrates the use of acos () method Example:
#!/usr/bin/python import math print "acos(0.64) : ", math.acos(0.64) print "acos(0) : ", math.acos(0) print "acos(-1) : ", math.acos(-1) print "acos(1) : ", math.acos(1)
After running the above example output is:
acos(0.64) : 0.876298061168 acos(0) : 1.57079632679 acos(-1) : 3.14159265359 acos(1) : 0.0