Inverse of Tan in python (tan-1)

后端 未结 3 957
南笙
南笙 2021-01-07 16:46

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)

相关标签:
3条回答
  • 2021-01-07 17:13

    you can simply multiply the radians by 180/pi. No need of importing ;)

    0 讨论(0)
  • 2021-01-07 17:16
    >>>from math import *
    >>>degrees(atan(1.18))
    >>>49.720136931043555
    
    0 讨论(0)
  • 2021-01-07 17:23

    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
    
    0 讨论(0)
提交回复
热议问题