math.acos()

Anonymous contributor's avatar
Anonymous contributor
Published Sep 17, 2024
Contribute to Docs

In Python, the math.acos() function returns the arc cosine (inverse cosine) of a number, expressed in radians.

Syntax

math.acos(x)
  • x: A number between -1 and 1 representing the cosine value for which the arc cosine is to be calculated.

The math.acos() function returns a numeric value in the range [0, π] in radians, which represents the inverse cosine of the value x.

Example

The example below demonstrates how to use the math.acos() function to calculate the arc cosine of 0:

import math
print(math.acos(0))

The above example gives the following output:

1.5707963267948966

Codebyte Example

The following codebyte example shows how the math.acos() function works:

Code
Output
Loading...

All contributors

Contribute to Docs

Learn Python on Codecademy