The cmath.acos()
function is used to compute the arc cosine of the given number.
cmath.acos(x)
x |
The number(real or complex) whose arc cosine we want. |
The function returns the arc cosine of x
in radians as a complex number. If argument x
is a real number, the returned complex number has 0j as its imaginary part.
import cmath
print(cmath.acos(1))
print(cmath.acos(0.5))
print(cmath.acos(2 + 3j))
print(cmath.acos(0.5-2j))
print(cmath.acos(3 + 5j))
You should note that the cmath(complex math) module is made primarily for working with complex numbers. If you are working with real numbers the math.acos() function maybe more relevant.