Learn and Learn

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

How to Find Inverse of Tan or Arctan in Python

To calculate the inverse of tan in Python, we use math.atan() function. The inverse of tan or tangent is also called arctan or arc tangent.
arctan graph


A theoretical detail can be found on Wikipedia.

“Arctan of x can be defined as the inverse of the tangent function of x where x is a real number (x∈ℝ).” It is an angle between −π/2 and +π/2 radians (or between −90° and +90°) whose tan is x.


arctan Special Values of Angles

Below is a table of some special values of angels of arctan or inverse of tan.

special angles values of arctan or inverse of tan


Some more theoretical and detailed explanation of values of arctan. can be found in the following table.

Some more arctan special angles and values


atan() Function in Python

math.atan() function is from Standard math Library of Python Programming Language. The purpose of this function is to calculate arc tan or the inverse of tan of any given number.


Syntax of atan() in Python

The syntax of atan() function in python is:
math.atan( x )


Parameters atan() in Python

x Any valid Python number (positive or negative). This parameter is required.
Note: if the x parameter is not a number, atan() function will return an error.


Python atan() Function Compatibility

atan() Function is compatible with both Python 2.x and 3.x versions.
Python 2.x – Yes
Python 3.x – Yes


Return Value of atan()

atan() function returns a floating point number ( a value of the inverse of tan in radians).


Python atan() Function Example

Output of Python atan() function:


Note that the unit of output of atan() function is in radian.


LearnAndLearn.com © 2018 - All rights reserved