Easy Tutorial
❮ Python Min List Element Python Timstamp Str ❯

Python3 acos() Function

Python3 Numbers


Description

The acos() function returns the arc cosine of x in radians.


Syntax

Here is the syntax for the acos() method:

import math

math.acos(x)

Note: The acos() function cannot be accessed directly. It is necessary to import the math module and then call this function using the math static object.


Parameters


Return Value

Returns the arc cosine of x in radians.


Example

The following example demonstrates the use of the acos() method:

#!/usr/bin/python3
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))

The output of the above example is:

acos(0.64) :  0.8762980611683406
acos(0) :  1.5707963267948966
acos(-1) :  3.141592653589793
acos(1) :  0.0

Python3 Numbers

❮ Python Min List Element Python Timstamp Str ❯