Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inverse of Tan in python (tan-1)

I am trying to calculate the inverse of tan in python, but it does not give me the correct value, for example, if I were to do the inverse tan of 1.18, math.atan(1.18)

>>>math.atan(1.18) 0.8677 

However, the correct answer is 49.720136931. What is the correct way to do than?

like image 952
user1294592 Avatar asked Apr 07 '12 19:04

user1294592


People also ask

How do you do inverse tan in Python?

The math. atan() method returns the arc tangent of a number (x) as a numeric value between -PI/2 and PI/2 radians. Arc tangent is also defined as an inverse tangent function of x, where x is the value of the arc tangent is to be calculated.

What is the inverse of tan-1?

The value of arctan 1 or tan inverse 1 is equal to π/4 radians or 45 degrees. Tan inverse 1 gives the measure of an angle of a right-angled triangle when the ratio of the perpendicular and the base is equal to 1.

How do you calculate tan inverse in Numpy?

arctan() in Python. numpy. arctan(x[, out]) = ufunc 'arctan') : This mathematical function helps user to calculate inverse tangent for all x(being the array elements).

How do you do inverse trig functions in Python?

To find the Trigonometric inverse sine, use the numpy. arcsin() method in Python Numpy. The method returns the sine of each element of the 1st parameter x. This is a scalar if x is a scalar.


1 Answers

math.atan(x) returned in radian, if you want degree, convert it using math.degrees(x)

Converts angle x from radians to degrees.  >>> import math >>> math.degrees(math.atan(1.18)) 49.720136931043555 
like image 83
George Avatar answered Oct 12 '22 12:10

George