python 角度和弧度转化

>>> import math
>>> math.degrees(math.pi/2)
90.0
>>> math.radians(90)
1.5707963267948966

sin(x) 返回x的正弦值(以弧度表示)。
sinh(x) 返回x的双曲正弦。
asin(x) 返回x的反正弦(以弧度表示)。
asinh(x) 返回x的反双曲正弦值。

>>> import math
>>> math.pi
3.141592653589793
>>> x=math.pi/2
>>> math.sin(x)
1.0
>>> math.sinh(x)
2.3012989023072947
>>> math.asin(0)
0.0
>>> math.asin(1)
1.5707963267948966
>>> math.asinh(1)
0.8813735870195429

cos(x) 返回x的余弦值(以弧度表示)。
cosh(x) 返回x的双曲余弦值。
acos(x) 返回x的反余弦(以弧度表示)。
acosh(x) 返回x的反双曲余弦值。

>>> import math
>>> x=math.pi/2
>>> math.cos(x)
6.123233995736766e-17
>>> math.cosh(x)
2.5091784786580567
>>> math.acos(x)
>>> math.acos(0)
1.5707963267948966
>>> math.acosh(1)
0.0

tan(x)   返回x的正切(以弧度表示)。
tanh(x)   返回x的双曲正切值。
atan(x)   返回x的反正切(以弧度表示)。
atan2(y,x)   返回y / x的反正切(以弧度表示)。与atan(y / x)不同,考虑x和y的符号。
atanh(x)   返回x的反双曲正切。

>>> import math
>>> x=math.pi/2
>>> math.tan(x)
1.633123935319537e+16
>>> math.tanh(x)
0.9171523356672744
>>> math.atan(0)
0.0
>>> math.atanh(0.5)
0.5493061443340549
>>> math.atan2(-1,2)
-0.4636476090008061



原文地址:https://www.cnblogs.com/sea-stream/p/10787152.html