Python math.acos() Method

❮ Math Methods


Example

Return the arc cosine of different numbers:

# Import math Library
import math

# Return the arc cosine of numbers
print(math.acos(0.55))
print(math.acos(-0.55))
print(math.acos(0))
print(math.acos(1))
print(math.acos(-1))
Try it Yourself »

Definition and Usage

The math.acos() method returns the arc cosine value of a number.

Note: The parameter passed in math.acos() must lie between -1 to 1.

Tip: math.acos(-1) will return the value of PI.


Syntax

math.acos(x)

Parameter Values

Parameter Description
x Required. A number in the range -1 to 1. If x is not a number, it returns a TypeError

Technical Details

Return Value: A float value, representing the arc cosine of a number
Python Version: 1.4

❮ Math Methods

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.