Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

How to Find Inverse of cosine in Python

To find out the inverse of cosine in Python we use math.acos() function of Python Standard math Library. The inverse of cosine is also called arc cosine.

acos() Function in Python

math.acos() function exists in Standard math Library of Python Programming Language. The purpose of this function is to calculate arc cosine or the inverse of the cosine of any given numeric value in the range of -1 and 1.


Syntax of acos() Function in Python

The syntax of acos() function in Python is:
math.acos( x )


Parameters of acos() Function in Python

x Any valid Python number (positive or negative within the range of -1 and 1). This parameter is required.
Note: if the x parameter is not a number, acos() function will return an error.


Python acos() Function Compatibility

Python 2.x – Yes
Python 3.x – Yes


Return Value of acos() Function in Python

acos() function returns a number ( a value of the inverse of cosine in radians).


Python acos() Function Example

Output of Python acos() function:

Note that the unit of output number is radian.


LearnAndLearn.com © 2018 - All rights reserved