Easy Tutorial
❮ Python Os Fstatvfs Python Get Dayago ❯

Python math.acos() Method

Python math Module

Python math.acos(x) returns the arccosine of x, with results ranging from 0 to pi.

The parameter accepted by math.acos() is between -1 and 1.

math.acos(-1) returns the math.pi constant.

Python Version: 1.4

Syntax

The syntax for the math.acos() method is as follows:

math.acos(x)

Parameter Description:

Return Value

Returns a floating-point number representing the arccosine of a number.

Example

The following example returns the arccosine of specified numbers:

Example

# Import math package
import math

# Print the arccosine values
print(math.acos(0.55))
print(math.acos(-0.55))
print(math.acos(0))
print(math.acos(1))
print(math.acos(-1))

Output result:

0.9884320889261531
2.15316056466364
1.5707963267948966
0.0
3.141592653589793

Python math Module

❮ Python Os Fstatvfs Python Get Dayago ❯