Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python math.acos() function returns arc cosine of a value. The return value will be in the range 0 through 𝜋.

Note: acos() is the inverse of cos().

Syntax

math.acos(x)

Parameters

x Required. Specify the value.

Return Value

Returns the arc cosine of the value.

Example:

In the below example, acos() function is used to find out the arc cosine of a given value.

import math

print(math.acos(0.5))
print(math.acos(1))
print(math.acos(2))

The output of the above code will be:

1.0471975511965979
0.0
ValueError: math domain error

❮ Python Math Module